Formula if cell contains number, another cell between a range return a specific number

Spoontang

New Member
Joined
Jan 25, 2018
Messages
10
Hello, I'm new to if, and formulas with this one returning a fault which I've tried numerous ways but obviously not the right way..

What I want is cell B24 will have 1 of 5 numbers,
Cell C24 a number between a range,
Another cell will return a given number,


IF((B24=25)(C24>3.4,C24<4.5),7)IF((B24=25)(C24=4.5,C24<5.5),8)

Hope this is clear enough for what I'm chasing? Appreciate some help please.
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
try this, fill in the "?" where there is no match

=IF(B24=25,IF(C24>3.4,IF(C24<4.5,7,IF(C24<5.5,8,"?")),"?"),"?")
 
Upvote 0
Maybe something like this:
Code:
=IF(AND((B24=25),(C24>3.4),(C24<4.5)),7,IF(AND((B24=25),(C24=4.5),(C24<5.5)),8))
However the bit with C24=4.5 makes no sense combining with C24<5.5 because 4.5 is always <5.5.
 
Upvote 0
Maybe something like this:
Code:
=IF(AND((B24=25),(C24>3.4),(C24<4.5)),7,IF(AND((B24=25),(C24=4.5),(C24<5.5)),8))
However the bit with C24=4.5 makes no sense combining with C24<5.5 because 4.5 is always <5.5.

Thanks Bobsan42, thats the one I was after.

I changed the =4.5 to >4.4 and <5.5 to <5.6 to keep the range 4.5, 5 or 5.5 =8.

I had the correct numbers but deleted everything when I couldn't get it to work and concentrated on a single set. I didn't get it to work so wrote some extra to show it was in multiples...

Much appreciated buddy, enjoy your day.
 
Upvote 0
Glad I could help.
It's worth to take a look at AlanY's suggestion - eventually his idea may produce a slightly shorter and optimized formula.
 
Upvote 0

Forum statistics

Threads
1,214,585
Messages
6,120,397
Members
448,957
Latest member
Hat4Life

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