Home Forums Chat Forum Excel help – IF function

Viewing 7 posts - 1 through 7 (of 7 total)
  • Excel help – IF function
  • guitarmanjon
    Free Member

    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

    gonefishin
    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.

    Stoner
    Free Member

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

    BoardinBob
    Full Member

    =IF(A1=A2,1,0)

    works for me

    guitarmanjon
    Free Member

    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.

    DougD
    Full Member

    Could you enter in A3 =A2=A1

    This should give you a true or false result.

    Stoner
    Free Member

    with the bloody square brackets in

    Remove all packaging before placing pizza in the oven 😉

Viewing 7 posts - 1 through 7 (of 7 total)

The topic ‘Excel help – IF function’ is closed to new replies.