Null in IF condition
How do I represent null in the else clause of if statement? A blank pair of double quotes ("") is not working. I want to concatenate values is a few columns if a column is not blank. If the column is blank, I want the if statement to return null.
This code works, but I want the value in "SEQ#" to be left padded with zeros for up to 2 digits.
I want the final value in the cell to be, for example: "JD-18-01" and not "JD-18-1".
=IF(NOT(ISBLANK([Story summary]@row)), [Assigned To]@row + "-" + [Sprint#]@row + "-") + [Seq#]@row
Answers
-
Essentially, there are two issues here.
- The value of the last column to be 01 instead of 1 (for example "JD-18-01" and not "JD-18-1".
- If the value in [Story Summary]@row is blank, do not populate anything, in other words, leave it blank.
-
Solving for #2 first is as simple as moving that closing parenthesis after the second "-" to the very end of the formula:
=IF(NOT(ISBLANK([Story summary]@row)), [Assigned To]@row + "-" + [Sprint#]@row + "-" + [Seq#]@row)
Solving for #1 requires a RIGHT statement that looks like this:
=IF(NOT(ISBLANK([Story summary]@row)), [Assigned To]@row + "-" + [Sprint#]@row + "-" + RIGHT("0" + [Seq#]@row, 2))
-
Thanks, Paul. That works great. I will try to understand how it works. I did not expect RIGHT function to work here. Thanks again.
-
Happy to help. 👍️
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Smartsheet Customer Resources
- 64.3K Get Help
- 423 Global Discussions
- 221 Industry Talk
- 461 Announcements
- 4.8K Ideas & Feature Requests
- 143 Brandfolder
- 143 Just for fun
- 59 Community Job Board
- 462 Show & Tell
- 32 Member Spotlight
- 1 SmartStories
- 300 Events
- 39 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!