IF formula between two numbers to give an output?

Marengah

New Member
Joined
May 30, 2024
Messages
2
Office Version
  1. 2019
Platform
  1. Windows
Hello everyone! Hope all is well.

I have this formula I created but it isnt outputting the result I need. =IF(E2<=4.99,"0-4",IF(AND(E2>=5,E2<=6.99,"5-6"),IF(AND(E2>=7,E2<=8.99,"7-8"),IF(AND(E2>=9,E2<=10.99,"9-10"),IF(AND(E2>=11,E2<=12.99,"11-12"),IF(AND(E2>=13,E2<=14.99,"13-14"),IF(E2>=15,"15+")))))))

So, I am trying to say if the number is greater than or equal to 5 but also less than or equal to 6.99 to output 5-6. Currently my formula is only picking up on the logic of the first part, so my outputs are 0-4 and a bunch of Falses. I just want my outputs to be 0-4, 5-6, 7-8 for the respective number that fall into each category.
Do I need to use IFS instead or how can I achieve my desired result?

Thank you well in advance!
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
Hi & welcome to MrExcel.
How about
Excel Formula:
=IF(E2<5,"0-4",IF(E2<7,"5-6",IF(E2<9,"7-8",IF(E2<11,"9-10",IF(E2<13,"11-12",IF(E2<15,"13-14","15+"))))))
 
Upvote 0
Hi & welcome to MrExcel.
How about
Excel Formula:
=IF(E2<5,"0-4",IF(E2<7,"5-6",IF(E2<9,"7-8",IF(E2<11,"9-10",IF(E2<13,"11-12",IF(E2<15,"13-14","15+"))))))
Thank you so much my friend. I guess the AND was definitely not needed LOL.
 
Upvote 0
Here is a more compact formula that you may want to try:
Excel Formula:
=LOOKUP(E2,{-100000,5,7,9,11,13,15},{"0-4","5-6","7-8","9-10","11-12","13-14","15+"})
 
Upvote 0
Glad we could help & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,224,818
Messages
6,181,152
Members
453,021
Latest member
Justyna P

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