If Statement

andreascostas

Board Regular
Joined
Jan 11, 2011
Messages
150
I have a decimal in cell a1 I need an If/and/or statement that can handle these conditions condidtions:
if A1 is between 0 and 0.2 then "close to zero", if A1 is between(0.4 and 0.6 then "close to half" and if it is greater than 0.79 then "close to one"
Thanks
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
What do you want to do if A1 is greater than .2 and less than .4 or greater than .6 and less than or equal to .79?
 
Upvote 0
See if this does what you need:

=IF(A1>0,IF(A1<=0.2,"close to zero",IF(A1>=0.4,IF(A1<=0.6,"close to half",IF(A1>0.79,"close to one","something else")))))
 
Upvote 0
Your middle condition is missing, the between 0.2 and 0.4 range, but perhaps:

=LOOKUP(A1,{0,0.2,0.79},{"Close to Zero","Close to Half","Close to One"})
 
Upvote 0
Are you sure my middle condition is missing? He doesn't have any condition between .2 and .4 the way I read it.
 
Upvote 0
I wasn't sure and still am not sure which way he meant that. Anyway, I like your solution better if it does what he wants.
 
Upvote 0

Forum statistics

Threads
1,214,982
Messages
6,122,573
Members
449,089
Latest member
Motoracer88

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top