forula for IF or True or False

jagankm

New Member
Joined
Apr 12, 2008
Messages
20
Hi very one
I am new to excel so please help me out for following


If the value cell A1 is 1 to 5 then value in cell B1 shall be 1,If the value in cell A1 is 6 to 15 then the value in cell B1 shall be 2, I the value in cell A1 is 16 to 30 than value in cell B1 shall be 3, If the value in cell A1 is 31 to 50 than the value in cell B1 shall be 4, if the value in cell A1 is 51 to 100 than the value in cell B1 shall be 5, If the value in cell A1 is greater than 100 then value in cell B1 shall be 6

Seems very complicated to me so please help me out

Regards
Jagan
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
=if(and(a1>=1,a1<=5),1,if(and(a1>=6,a1<=15),2,if(and(a1>=16,a1<=30),3,if(and(a1>=51,a1<=50),4,if(and(a1>=51,a1<100),5,6)))))
 
Upvote 0
Hi, try:

=LOOKUP(A1,{1,6,16,31,51,101},{1,2,3,4,5,6})
 
Upvote 0
=if(and(a1>=1,a1<=5),1,if(and(a1>=6,a1<=15),2,if(and(a1>=16,a1<=30),3,if(and(a1>=51,a1<=50),4,if(and(a1>=51,a1<100),5,6)))))

If A1 is not ever going to be <1 then it can be simplified to
=if(a1<=5,1,if(a1<=15,2,if(a1<=30,3,if(a1<=50,4,if(a1<100,5,6)))))
If it could be <1 then
=if(a1<1,"less than 1", if(a1<=5,1,if(a1<=15,2,if(a1<=30,3,if(a1<=50,4,if(a1<100,5,6))))))
 
Upvote 0
FormR's solution is more versatile if there are other results to return, but given the specific numbers you want returned, this should suffice.

=MATCH(A1,{1,6,16,31,51,101})
 
Upvote 0

Forum statistics

Threads
1,214,599
Messages
6,120,448
Members
448,966
Latest member
DannyC96

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