Help with Excel formula.

Robocop

Expert Member
Joined
Mar 5, 2007
Messages
1,012
Reaction score
341
Location
Johannesburg
I need help with a Excel formula.

What I basically need to do is have one cell check the value of another cell. If the value is less than or equal to 100 it should return a value(A) from a table. If the value is less than or equal to 150, but bigger that 100, it should return another another value (B). If the value is less than or equal than 250, but bigger that 150 it should return value (C)…..etc.
 
What you looking at is a Select Case.
Dont know if its in Excel though.

Can use If statement.
=If(.. Do test ... , true, False)
e.g. =if(D5<100,A,B)
Can do multiple If's - untidy but dont know about Select.
e.g. =if(D5<100,A,if(100<D5<150,B, if(....)
Maybe even a vlookup using the option to search for the closest value
So create a table like:
100 A
101 B
149 B
151 C
199 C
200 D
Set the Range lookup to false so it finds the closest value.
 
Last edited:
Mulitple IF and vlookup example.........so that each false contain another IF statement...you will have to continue the if statement to expand the check range

=IF(A2<=100,VLOOKUP(1,$A$6:$B$10,2,TRUE),(IF((AND(($A$2>100),($A$2<=150))),VLOOKUP(2,$A$6:$B$10,2,TRUE),FALSE)))

easiest method would be to write an Excel macro and use the case statement.

Vlookup table
Pos Value
1 A
2 B
3 C
4 D
5 E
 
Last edited:
I need help with a Excel formula.

What I basically need to do is have one cell check the value of another cell. If the value is less than or equal to 100 it should return a value(A) from a table. If the value is less than or equal to 150, but bigger that 100, it should return another another value (B). If the value is less than or equal than 250, but bigger that 150 it should return value (C)…..etc.

Not sure if I misunderstand but all I think you need is ta simple lookup table (vlookup or hlookup function)
 
I agree with mikef.

Seems like you need a vlookup or hlookup with if statement

PM me if you havent solved it and I will gladly help you with the code
 
Top
Sign up to the MyBroadband newsletter
X