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)


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

Help Article Resources
Categories
Check out the Formula Handbook template!