How to do a complex if and formula in excel

kman

New Member
Joined
Dec 11, 2002
Messages
35
I want to know how to do the following in excel I've written if and loops but I haven't been able to figure this one out.

I have numbers in column B

If the value in column B are greater then 0 and less than or equal to .25 I want to display the number 1
If the value in column B are greater then .25 but less than or equal to .50 I want to display the number 2
If the value in column B are greater then .50 but less than or equal to .75 I want to display the number 3
If the value in column B are greater then .75 but less than or equal to 1.00 I want to display the number 4
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
=IF(OR(B1="",B1>1),"",LOOKUP(B1,{0,0.25,0.5,0.75},{1,2,3,4}))

I did not take into account negative numbers but I hope you will not enter them
but if this is going to happen
=IF(OR(B1="",B1>1,B1<1),"",LOOKUP(B1,{0,0.25,0.5,0.75},{1,2,3,4}))
 
Upvote 0
I did not take into account negative numbers but I hope you will not enter them
but if this is going to happen
=IF(OR(B1="",B1>1,B1<1),"",LOOKUP(B1,{0,0.25,0.5,0.75},{1,2,3,4}))
You probably meant =IF(OR(B1="",B1>1,B1<0),"",LOOKUP(B1,{0,0.25,0.5,0.75},{1,2,3,4}))
 
Upvote 0

Forum statistics

Threads
1,213,510
Messages
6,114,048
Members
448,543
Latest member
MartinLarkin

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