If Statement Returning Different value if a cell has a single digit in it versus a two digit number
See the sheet below. In the SLA Tally column I want it to look at the [Age of Defect] and if it is larger than [P SLA] return that it is "Outside SLA".
If you see on Row 4, it works correctly. It is recognizing that age of the defect is 7, and it is above the SLA range of 7, and returning "Outside SLA".
However, when the [Age of Defect] column goes to a double digit number, in this instance 12, it then outputs "In SLA"
The if statement formula in that column is the following:
=IF([Age of Defect]@row > [P SLA]@row, "Outside SLA", "In SLA")
NOTE: The [P SLA] column value and the [Age of Defect] column values are results of a formula in those columns.
For instance, [P SLA] value is:
=IF(Criticality@row = "P2  Major", "3", IF(Criticality@row = "P1  Critical", "3", IF(Criticality@row = "P3  Minor", "4", IF(Criticality@row = "P4  Low", "5", IF(Criticality@row = "Enhancement", "30")))))
When the number in a column is obtained via a formula, will IF statement not work correctly?
thanks,
Shaun
Best Answers

Hi @mint72s
I hope you're well and safe!
To add to Intern98's excellent advice/answer.
Another option could be to make sure that the formula reads the cells as values using the VALUE function.
Did that work/help?
I hope that helps!
Be safe and have a fantastic week!
Best,
Andrée Starå  Workflow Consultant / CEO @ WORK BOLD
✅Did my post(s) help or answer your question or solve your problem? Please support the Community by marking it Insightful/Vote Up or/and as the accepted answer. It will make it easier for others to find a solution or help to answer!
SMARTSHEET EXPERT CONSULTANT & PARTNER
Andrée Starå  Workflow Consultant / CEO @ WORK BOLD
W: www.workbold.com  E:andree@workbold.com  P: +46 (0)  72  510 99 35
Feel free to contact me for help with Smartsheet, integrations, general workflow advice, or anything else.

To add on,
values that are enclosed in " " are considered strings and hence calculation maybe not be accurate.
If integers are of concern, using If formula without " " in the true, false value will automatically return an integer.
=IF( a=b, "1","2") str
=IF( a=b, 1,2) int
Answers

Hi, you can try modifying your column formula for PSLA and Age of defect by adding:
=INT( your existing formula)
Do let me know if it helped.

Hi @mint72s
I hope you're well and safe!
To add to Intern98's excellent advice/answer.
Another option could be to make sure that the formula reads the cells as values using the VALUE function.
Did that work/help?
I hope that helps!
Be safe and have a fantastic week!
Best,
Andrée Starå  Workflow Consultant / CEO @ WORK BOLD
✅Did my post(s) help or answer your question or solve your problem? Please support the Community by marking it Insightful/Vote Up or/and as the accepted answer. It will make it easier for others to find a solution or help to answer!
SMARTSHEET EXPERT CONSULTANT & PARTNER
Andrée Starå  Workflow Consultant / CEO @ WORK BOLD
W: www.workbold.com  E:andree@workbold.com  P: +46 (0)  72  510 99 35
Feel free to contact me for help with Smartsheet, integrations, general workflow advice, or anything else.

To add on,
values that are enclosed in " " are considered strings and hence calculation maybe not be accurate.
If integers are of concern, using If formula without " " in the true, false value will automatically return an integer.
=IF( a=b, "1","2") str
=IF( a=b, 1,2) int

Hello @Intern98 and @Andrée Starå so much for the quick responses!!!
I have to say, after seeing your responses, I just had to do a "face palm"......the answer was really so simple!! lol I guess this is what happens when I had been working on this certain dashboard for several hours, this was the last component, that when I got it to work....all of my data was going to look so good!!! At the time of sending my request for help, I had been working on it about 6 hours, it was 2AM and I probably should have just gone to bed!!
Both of you answered my question and I am now all set!!!
Again, thank you so much, and best wishes!!!

Haha! Easy to miss!
Happy to help!
✅Please support the Community by marking the post(s) that helped or answered your question or solved your problem with the accepted answer/helpful. It will make it easier for others to find a solution or help to answer!
SMARTSHEET EXPERT CONSULTANT & PARTNER
Andrée Starå  Workflow Consultant / CEO @ WORK BOLD
W: www.workbold.com  E:andree@workbold.com  P: +46 (0)  72  510 99 35
Feel free to contact me for help with Smartsheet, integrations, general workflow advice, or anything else.
Help Article Resources
Categories
 All Categories
 14 Welcome to the Community
 Smartsheet Customer Resources
 63.9K Get Help
 410 Global Discussions
 220 Industry Talk
 458 Announcements
 4.8K Ideas & Feature Requests
 143 Brandfolder
 136 Just for fun
 57 Community Job Board
 459 Show & Tell
 31 Member Spotlight
 1 SmartStories
 298 Events
 37 Webinars
 7.3K Forum Archives
Check out the Formula Handbook template!