Confounding Behavior with IF Statement
Hello all,
I've run into an issue around what should be an entry level IF statement. I'm comparing numbers in two columns, one of which is derived from a time calculation. The formula is looking to determine if the two values are greater than or equal to one another and outputs a simple "Yes" or "No" depending on the values. I have an instance where the two values are equal but the formula is yielding "No."
I've reached out to customer support who suggested I clear the values, save the sheet, add them again and check. I received the same answer via the formula.
Thank you in advance.
Best Answer
-
This formula works.
=IF(AND([In - Min Hours]@row <= [In - Total Hours Worked]@row, [In - Min Hours]@row <> ""), "Yes", IF([In - Total Hours Worked]@row = "", "", "No"))
If you copy and it's not working, then try entering numbers in the In - Min Hours and In - Total Hours Worked. It's possible there is some fraction of a second beyond what is showing causing the issue so you may want to round it in the formula.
Answers
-
This formula works.
=IF(AND([In - Min Hours]@row <= [In - Total Hours Worked]@row, [In - Min Hours]@row <> ""), "Yes", IF([In - Total Hours Worked]@row = "", "", "No"))
If you copy and it's not working, then try entering numbers in the In - Min Hours and In - Total Hours Worked. It's possible there is some fraction of a second beyond what is showing causing the issue so you may want to round it in the formula.
-
You were correct regarding there being a rounding issue. Although both appear to be the same, placing ROUND in the IN - Total Hours Worked did the trick. Thank you for the suggestion.
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Smartsheet Customer Resources
- 64.1K Get Help
- 414 Global Discussions
- 221 Industry Talk
- 461 Announcements
- 4.8K Ideas & Feature Requests
- 143 Brandfolder
- 141 Just for fun
- 58 Community Job Board
- 462 Show & Tell
- 32 Member Spotlight
- 1 SmartStories
- 299 Events
- 38 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!