Excel help - IF fun...
 

  You don't need to be an 'investor' to invest in Singletrack: 6 days left: 95% of target - Find out more

[Closed] Excel help - IF function

6 Posts
5 Users
0 Reactions
47 Views
Posts: 0
Free Member
Topic starter
 

I thought using the IF function would be pretty straightforward.

I want to compare 2 cells, both containing numbers, and evaluate if they are equal in a 3rd cell. E.g.

| 3 | 4 | =IF(A1=A2,[1],[0] |

This example should return a 0 because 3 does not equal 4.

Can anyone see why this wouldn't work? Excel claims the formula has an error in it.

Cheers
jon


 
Posted : 19/08/2011 12:05 pm
Posts: 3729
Free Member
 

Try changing the formula to A1-A2=0 rather than A1=A2.

Oh and are the figure EXACTLY those integers? If there are any decimals in there then this sort of comparison can be tricky to get right and you may have to use something like A1-A2 < x where x is suitably close to zero for your requirements.


 
Posted : 19/08/2011 12:06 pm
Posts: 36
Free Member
 

in A3 type: =if(A1=A2, 1, 0)


 
Posted : 19/08/2011 12:07 pm
Posts: 14711
Full Member
 

=IF(A1=A2,1,0)

works for me


 
Posted : 19/08/2011 12:08 pm
Posts: 0
Free Member
Topic starter
 

Cheers Stoner, sorted. I blame the Excel function description which says IF(logical_test,[value_if_true],[value_if_false]) with the bloody square brackets in.


 
Posted : 19/08/2011 12:09 pm
Posts: 719
Full Member
 

Could you enter in A3 =A2=A1

This should give you a true or false result.


 
Posted : 19/08/2011 12:10 pm
Posts: 36
Free Member
 

with the bloody square brackets in

Remove all packaging before placing pizza in the oven 😉


 
Posted : 19/08/2011 12:15 pm

6 DAYS LEFT
We are currently at 95% of our target!