SOLVED

SharePoint Calculated Column if statements with 3 arguments

Copper Contributor

I am stuck in writing a calculated column. Alist column has a range of blood alcohol content ranging from 0.00-0.500. I originally created this calculation:

 

=IF([Breath Test Result]<=0.08,"Legal Limit","Illegal Limit")

 

however, it only worked for 2 arguments and not accounting for the N/A selection. I then adjusted to this one:

 

=IF([Breath Test Result]<0.80,"Legal",IF(AND([Breath Test Result]>0.081,[Breath Test Result]<=0.500),"Illegal",IF([Breath Test Result]="n/a","no results)))

 

but SharePoint 365 is telling me that the syntax is wrong. Can anyone please help?

6 Replies

@TonyTone365 

 

What is the type of Breath Test Result field? is it Choice field or Number field?

@TonyTone365 Try using below formulas and see which one works best for your requirements: 

 

=IF([Breath Test Result]<0.80,"Legal",IF(AND([Breath Test Result]>0.081,[Breath Test Result]<=0.500),"Illegal",IF([Breath Test Result]="N/A","No Results,"")))

 

OR

 

=IF(OR(ISBLANK([Breath Test Result]),[Breath Test Result]="N/A"),"No Results,IF(Value([Breath Test Result])<0.80,"Legal",IF(AND(Value([Breath Test Result])>0.081,Value([Breath Test Result])<=0.500),"Illegal","")))

 


Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.

For SharePoint/Power Platform blogs, visit: Ganesh Sanap Blogs

The you for responding. The breath Test Result is a choice field... for example:
n/a
0.001
0.002
0.003
...
0.499
0.500
@ganeshsanap, I appreciate you looking into these formulas. I tried plugging in your suggestions but continue to get an error message. I am no expert in SharePoint, clearly, so I am not sure if it should be known that the "Breath Test Result" is a choice field ranging from 0.001 to 0.500. It is not a number field and don't know if it makes a difference.
best response confirmed by TonyTone365 (Copper Contributor)
Solution

@TonyTone365 I missed one double quote ( " ) in my response above, try using this formula: 

 

=IF(OR(ISBLANK([Breath Test Result]),[Breath Test Result]="N/A"),"No Results",IF(Value([Breath Test Result])<0.80,"Legal",IF(AND(Value([Breath Test Result])>0.081,Value([Breath Test Result])<=0.500),"Illegal","")))

 


Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.

For SharePoint/Power Platform blogs, visit: Ganesh Sanap Blogs

@ganeshsanap Thank you so much! It worked, you did it.

This is amazing, I appreciate you and this community.