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
- Customer Resources
- 64.9K Get Help
- 441 Global Discussions
- 139 Industry Talk
- 472 Announcements
- 4.9K Ideas & Feature Requests
- 129 Brandfolder
- 148 Just for fun
- 68 Community Job Board
- 496 Show & Tell
- 33 Member Spotlight
- 2 SmartStories
- 300 Events
- 36 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!