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
- 64.8K Get Help
- 434 Global Discussions
- 138 Industry Talk
- 470 Announcements
- 4.9K Ideas & Feature Requests
- 129 Brandfolder
- 148 Just for fun
- 65 Community Job Board
- 486 Show & Tell
- 33 Member Spotlight
- 2 SmartStories
- 300 Events
- 36 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!