3 ms·
Do you know about the LET function? It lets you make lexically scoped variables. And the IFS function is basically an if-elif(-elif...)-else chain, eliminating
by _dain_ 4y ago
Do you know about the LET function? It lets you make lexically scoped variables. And the IFS function is basically an if-elif(-elif...)-else chain, eliminating nested IF. So your example would be:
=LET(
foo, LongExpression,
bar, OtherLongExpression,
baz, AnotherLongExpression,
bax, YetAnotherLongExpression
IFS(
AND(foo > 3, bar < 5), baz,
AND(foo > 5, bar < 10), bax,
TRUE, 0))
The formula bar can be resized and you can insert new lines with alt-enter. Sadly there's no easy way to indent, you just have to tap the spacebar (or write the formulae in Notepad++ and copypaste across like I do). Also I recommend using Lisp style "close parentheses all at the end of the line" style, rather than "Egyptian brackets".
- Enginerrrd 4y agoHey, this is all incredibly helpful! LET alone will be very helpful for all the empirical fluid mechanics formulas I have to deal with. Thanks a lot friend! Also, just out of curiosity, why do you recommend that particular bracket style?
- _dain_ 4y agoVertical space is at a premium, no sense in having lines with nothing but a single close paren. You don't want to drag down the formula bar and start hearing the Star Wars title crawl music in your head. It's worth checking out the big alphabetical list of formulae, there's a lot of things that many people don't know are there. Look at the ones with the "Office 365" or "2019" labels for recently added ones (although annoyingly those are icons rather than text so you can't ctrl-f): https://support.microsoft.com/en-us/office/excel-functions-alphabetical-b3944572-255d-4efb-bb96-c6d90033e188 https://support.microsoft.com/en-us/office/excel-functions-a... Also check out my other comment in this thread about tables if you don't already know what those are all about. And Powerquery too.