Leave blank if row level < 2
I have a column formula with several nested IF statements.
I want to add a condition at the start which says "If row is level 0 or 1, leave this blank; otherwise, run the rest of the formula."
So I think I need something like this:
=IF(LEVEL(Code@row < 2, "", [insert the rest of the formula here, starting with IF]))
But it says that my syntax isn't right  what am I missing?
Thank you!
Best Answer

Hi @malden
The LEVEL function doesn't exist, so this is what is causing your error.
You could use something like:
=IF(COUNT(ANCESTORS([Another column here]@row))<2,"",<remainder of your formula>)
For [Another column here], just pick any column that isn't the one with your formula in, else it won't display anything.
Example:
Hope this helps, but if you've any problems/questions then just post!
Answers

Hi @malden
The LEVEL function doesn't exist, so this is what is causing your error.
You could use something like:
=IF(COUNT(ANCESTORS([Another column here]@row))<2,"",<remainder of your formula>)
For [Another column here], just pick any column that isn't the one with your formula in, else it won't display anything.
Example:
Hope this helps, but if you've any problems/questions then just post!

LEVEL is not a valid function within Smartsheet. Try a COUNT/ANCESTORS instead.
=IF(COUNT(ANCESTORS())> 1, existing_nested_if)
Come see me in Seattle at ENGAGE 2024! I will be at the 10xViz partner booth throughout as well as the "Lets Talk About Community" Meet & Eat table on Tuesday from 11:45am  12:45pm!


@Nick Korna @Paul Newcome @JamesB Thanks, everyone. I don't know where I got "=(LEVEL" as a function! The ancestor count worked.

Happy to help. 👍️
Come see me in Seattle at ENGAGE 2024! I will be at the 10xViz partner booth throughout as well as the "Lets Talk About Community" Meet & Eat table on Tuesday from 11:45am  12:45pm!
Help Article Resources
Categories
 All Categories
 14 Welcome to the Community
 Smartsheet Customer Resources
 63K Get Help
 380 Global Discussions
 212 Industry Talk
 442 Announcements
 4.6K Ideas & Feature Requests
 140 Brandfolder
 129 Just for fun
 130 Community Job Board
 449 Show & Tell
 30 Member Spotlight
 1 SmartStories
 305 Events
 34 Webinars
 7.3K Forum Archives
Check out the Formula Handbook template!