Easy way to make highly nested conditionals

Forum rules
No question in this section please
For any question related to a topic, create a new thread in the relevant section.
Post Reply
Bald Eagle
Posts: 68
Joined: Wed Apr 19, 2017 9:22 pm

Easy way to make highly nested conditionals

Post by Bald Eagle »

I've been working with OpenOffice Calc for a while now, and found myself wanting to process some data that required a lot of if-then-else type conditions.
I found the edit-in-cell [Ctrl][Enter] trick to add line breaks in the formula to make it more readable, but something caught my eye and I had an "aha!" moment.

The only real condition you're focusing writing in the current cell is the IF portion. Else could be the result of some other test in another cell.
And that could go on an on, chaining them together.
So I "stacked" the conditional cells, and the added benefit of this was that by just copying the formula up one cell, another layer could be added to the nested conditional.
Delete the top cells, and the outer layer of the nest is removed. Super simple.

I made a little spreadsheet to demonstrate.
Questions, comments, constructive criticism, and improvements are most welcome.
Attachments
Nested_Conditionals.ods
(15.54 KiB) Downloaded 802 times
OpenOffice 4.1.1 on Windows 7
njhub
Posts: 33
Joined: Thu May 17, 2018 8:36 am
Location: Mayotte YT

Re: Easy way to make highly nested conditionals

Post by njhub »

Hi Bald Eagle,

Thank's for your spreadsheet.

Can you update it with, so it will be easier to read, with a sentence according true/false

Code: Select all

=SI(B8;"Input cell is empty";"Input cell isn't empty")&T(STYLE(SI(B8;"GreenStyle";"RedStyle")))
LibreOffice (fr_YT): 6.1.4.2 (26/12/2018)
OS : Windows 10.0
Post Reply