ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   If Function (https://www.excelbanter.com/excel-worksheet-functions/8811-if-function.html)

BHUD

If Function
 
How would you write this equation?
If value in cell A2 is between 98 and 112 return the word green, If the
value of cell A2 in between 128 and 131 return the word blue, If the value of
cell A2 is between 140 and 145 return the word black, and if the value of
cell A2 is "clinic" return the word red, anything else return 0.


Jason Morin

One way:

=IF(AND(A2=98,A2<=112),"green",IF(AND
(A2=128,A2<=131),"blue",IF(AND
(A2=140,A2<=145),"black",IF(A2="clinic","red",0)) ))

HTH
Jason
Atlanta, GA

-----Original Message-----
How would you write this equation?
If value in cell A2 is between 98 and 112 return the

word green, If the
value of cell A2 in between 128 and 131 return the word

blue, If the value of
cell A2 is between 140 and 145 return the word black,

and if the value of
cell A2 is "clinic" return the word red, anything else

return 0.

.



All times are GMT +1. The time now is 06:39 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com