Solved if condition doesn't work on formula generated cell

January 7, 2013 at 02:53:39
Specs: Windows 7
Weird behavior of excel
I have the below information in my excel
A1: String value of 10+20
A2: Number 5
In A3 I am reading the number before “+” in A1 using “=Left(A1, Find(“+”,A1)-1)”. I got the number 10
I want to have a formula in my A4 whereby I should compare A3 with A2. If A3 less than or equal to A2 return “True” else return “False”. So I had the standard if condition “=if(A3<=A2,”True”,”False”)”
But the if condition does not work since the number in A3 is a formula generated number and not a keyed in number.
How to fix the problem??

See More: if condition doesnt work on formula generated cell

Report •


#1
January 7, 2013 at 04:50:22
✔ Best Answer
Try this:

=LEFT(A1,FIND("+",A1)-1)+0

or

=LEFT(A1,FIND("+",A1)-1)*1

or

=IF(A2<=A3+0,"True","False")

or

=IF(A2<=A3*1,"True","False")

Since the LEFT function returns text, you have to force Excel to convert it to a number before you can perform a <= operation on it.

Click Here Before Posting Data or VBA Code ---> How To Post Data or Code.


Report •
Related Solutions


Ask Question