Anirudh Lou
Anirudh Lou

Reputation: 841

How to properly get if a number is between two given numbers in excel?

Given this rule to follow:

enter image description here

And I have some value to check from this:

enter image description here

Where cell AA727 is a result of some calculations which I already formatted into a number (this includes all operands involved). In cell O727, I have this formula: =IF(AND(AA727>=A14;AA727<=B14);"True";"False"). I am wondering why it gives me False, when it is supposed to be True? But if I manually entered 1.00 into cell AA727 it gives me True.

Any help or suggestion is very much appreciated.

Upvotes: 0

Views: 622

Answers (3)

Adrian Nielsen
Adrian Nielsen

Reputation: 1

I had the same problem but vlookup was not appropriate. I found by wrapping my cell function in:

=INT(myFunction)

resolved my issue.

For your case, consider wrapping the cell inside the Int function. For example,

=IF(AND(INT(AA727)>=INT(A14),INT(AA727)<=INT(B14)),"True","False")

Upvotes: 0

cco
cco

Reputation: 33

try like this casting the references:

=IF(AND(num(AA727)>=num(A14);num(AA727)<=num(B14));"True";"False")

Upvotes: 0

Solar Mike
Solar Mike

Reputation: 8415

Just so the question has an answer:

I would suggest something like this with vlookup():

=vlookup(aa727,A13:C23,3,1)

Do test with all the values and adjust the numbers as needed.

Upvotes: 1

Related Questions