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.
-
Happy to help. 👍️
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Customer Resources
- 65.4K Get Help
- 447 Global Discussions
- 144 Industry Talk
- 479 Announcements
- 5.1K Ideas & Feature Requests
- 85 Brandfolder
- 151 Just for fun
- 72 Community Job Board
- 490 Show & Tell
- 33 Member Spotlight
- 2 SmartStories
- 305 Events
- 37 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!