Multiple IF conditions

I need help with the IF function in a string based on multiple selections in a cell.
I need the formula to have difference values based on users selecting multiple items in a cell.
Follow is my attempt at the formula, but clearly not working:
=IF(HAS([RESOURCES]@row, "RESOURCE 1"), 1), IF([RESOURCES], "RESOURCE 1", "RESOURCE 2"), 2), IF([RESOURCES], "RESOURCE 1", "RESOURCE 2", "RESOURCE 3"), 3))
Image of the Smartsheet:
RESOURCES | TOTAL SHTS |
---|---|
RESOURCE 1 |
The formula should result with the following:
IF ONLY RESOURCE 1 IS SELECTED - THEN TOTAL SHEETS = 1
IF RESOURCE 1 AND 2 IS SELECTED - THEN TOTAL SHEETS = 2
IF RESOURCE 1, 2 AND 3 IS SELECTED - THEN TOTAL SHEETS = 3
Most probably pretty straight forward, but you never know!
Best Answer
-
Hi @KempenUSA
Is your RESOURCES column a dropdown that allows multiple selections? If so, you can use something like this:
=IF(COUNTM(Resources@row) = 1, 1, IF(COUNTM(Resources@row) = 2, 2, IF(COUNTM(Resources@row) = 3, 3)))
Alternatively if your resources are sequential (e.g 3 is never picked without 1 & 2, and 2 is never picked without 1) then you could use something like this:
=IF(HAS(Resources@row, "Resource 3"), 3, IF(HAS(Resources@row, "Resource 2"), 2, IF(HAS(Resources@row, "Resource 1"), 1)))
Hope this helps, but if you've any problems/questions then just let us know!
Answers
-
Hi @KempenUSA
Is your RESOURCES column a dropdown that allows multiple selections? If so, you can use something like this:
=IF(COUNTM(Resources@row) = 1, 1, IF(COUNTM(Resources@row) = 2, 2, IF(COUNTM(Resources@row) = 3, 3)))
Alternatively if your resources are sequential (e.g 3 is never picked without 1 & 2, and 2 is never picked without 1) then you could use something like this:
=IF(HAS(Resources@row, "Resource 3"), 3, IF(HAS(Resources@row, "Resource 2"), 2, IF(HAS(Resources@row, "Resource 1"), 1)))
Hope this helps, but if you've any problems/questions then just let us know!
-
@Nick Korna Works perfect, Thank you!
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Customer Resources
- 67.8K Get Help
- 474 Global Discussions
- 206 Use Cases
- 517 Announcements
- 5.5K Ideas & Feature Requests
- 87 Brandfolder
- 157 Just for fun
- 83 Community Job Board
- 521 Show & Tell
- 36 Member Spotlight
- 3 SmartStories
- 309 Events
- 37 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!