Help with IFS statement

Vasylian223

New Member
Joined
Apr 30, 2020
Messages
3
Hello.
I'm currently doing a project, in which i must do something like this:

If value of a cell, let's say B4 is less than 1.5 it is "1", if it's Equal to or Greater than 1.5 BUT Less than 2.5, it is "2", if it's Equal to or Greater than 2.5 BUT Less than 3.5, it is "3"... until if it's Equal to or Higher than 4.5 but not greater than 5 then it's "5"...

The formula i would use is:
IFS(B4<=1.5,"1",B4>=1.5<2.5,"2",B4=2.5<3.5,"3",B4>=3.5<4.5,"4",B4>=4.5<5,"5")
but the formula doesn't work and it results in #N/A.
What would correct formula be for that?
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
Hi & welcome to MrExcel.
You don't need to test for >=, so you can just use
=IFS(B4<=1.5,"1",B4<2.5,"2",B4<3.5,"3",B4<4.5,"4",B4<5,"5")
Although the result of the formula will be text, not numbers.
 
Upvote 0
Thank you, but i need, for example, "2" to be in range from 1.5 to 2.5, but not equal to 2.5, not just less than 2.5
 
Upvote 0
Have you actually tried it?
 
Upvote 0
Why don't you just round it, adding a test for any outlier conditions?
 
Upvote 0
Have you actually tried it?
I'm so sorry, i've tried it and it worked, though i had to add "=" here ...,B4<=5,"5") , it didn't worked in the coloumn that had 5 so that's why i thought that it didn't work. Thank you for helping me!

Why don't you just round it, adding a test for any outlier conditions?
Because it's pretty important to be in ranges like this <1.5 , >=1.5<2.5, etc...
 
Upvote 0
Rory's idea gives the same result as the IFS, depending on what should happen if it's above 5

+Fluff New.xlsm
ABC
4IFSRoundValue
5110.2
6111.5
7221.6
8222.4
9332.5
10333.4
11443.5
12444.4
13554.5
14555
15#N/A55.1
Master
Cell Formulas
RangeFormula
A5:A15A5=IFS(C5<=1.5,"1",C5<2.5,"2",C5<3.5,"3",C5<4.5,"4",C5<=5,"5")
B5:B15B5=IF(C5<=1.5,1,ROUND(C5,0))
 
Upvote 0

Forum statistics

Threads
1,214,375
Messages
6,119,166
Members
448,870
Latest member
max_pedreira

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