Welcome to the Smartsheet Forum Archives
The posts in this forum are no longer monitored for accuracy and their content may no longer be current. If there's a discussion here that interests you and you'd like to find (or create) a more current version, please Visit the Current Forums.
Number Range for Logic Function
Hello! I have a range of numbers I need to include in a logic function, specifically:
< 3 = XS
48 = S
916= M
1739= L
>40= XL
This is my logic string, and I've used a similar one in a previous sheet, but I know my number range isn't correct, but cannot figure out how it should be. Thanks for any help!
=IF([Effort Required in Hours]1 = <4, "XS", IF([Effort Required in Hours]1 = 4 and <9, "S", IF([Effort Required in Hours]1 = 9 and <17, "M", IF([Effort Required in Hours]1 = 17 and <40, "L", IF([Effort Required in Hours]1 = >40, "XL")))))
Comments

Your and statements aren't inputted correctly... Try this and see if it works.
=IF([Effort Required in Hours]1 = <4, "XS", IF(AND([Effort Required in Hours]1 = 4, [Effort Required in Hours]1 <9), "S", IF(AND([Effort Required in Hours]1 = 9, [Effort Required in Hours]1 <17), "M", IF(AND([Effort Required in Hours]1 = 17, [Effort Required in Hours]1 <40), "L", IF([Effort Required in Hours]1 = >40, "XL")))))

It still says "Invalid Operation", but that is much closer. I'll see if I can play around with it more to get it to work. Thank you!

I see the issue...
Try this and see if it works.
=IF([Effort Required in Hours]1 <4, "XS", IF(AND([Effort Required in Hours]1 >= 4, [Effort Required in Hours]1 < 9), "S", IF(AND([Effort Required in Hours]1 >= 9, [Effort Required in Hours]1 < 17), "M", IF(AND([Effort Required in Hours]1 >= 17, [Effort Required in Hours]1 <40), "L", IF([Effort Required in Hours]1 >= 40, "XL")))))
I use this link to troubleshoot error messages in SmartSheets
https://help.smartsheet.com/articles/2476176formulaerrormessages 
I made a couple edits to that formula I reposted  make sure to load the thread and test it as written.

You are brilliant and that worked! Thank you so much!

You're welcome!

Just on a side note, the additional checks for greater or equal are unnecessary. IF statements stop on the first match. So by default, if it didn't match "<4", it's automatically ">=4". This can greatly simplify the calculations:
=IF([Effort Required in Hours]1 <4, "XS", IF([Effort Required in Hours]1 < 9), "S", IF([Effort Required in Hours]1 < 17), "M", IF([Effort Required in Hours]1 <40), "L", "XL"))))

Good point! That is true and makes for a simpler calculation. Nice revision.

I'm trying to do something similar but I keep getting #UNPARSEABLE. I cannot see what I've typed wrong.
=IF([Points]1 <99, IF([Points]1 <199, “Apprentice”, IF([Points]1 <499, “Amateur”, IF([Points]1 <999, “Pro”, IF([Points]1 <1999, “Veteran”, IF([Points]1 <= 3999, “Expert”, IF([Points]1 = 4000, “Master”)))))))
Thoughts on what I might be missing?
Categories
 All Categories
 14 Welcome to the Community
 10.7K Get Help
 63 Global Discussions
 69 Industry Talk
 385 Announcements
 3.5K Ideas & Feature Requests
 55 Brandfolder
 125 Just for fun
 50 Community Job Board
 464 Show & Tell
 40 Member Spotlight
 44 Power Your Process
 28 Sponsor X
 234 Events
 7.3K Forum Archives