Search code examples
excelif-statementcompareexcel-formulaworksheet-function

Compare two cells and place the result in a third


I would like to compare in Excel two fields per column and place a flag in a third field:

If the table looks like:

+---+--------+----------+---+
|   |   A    |    B     | C |
+---+--------+----------+---+
| 1 | 100,00 | 100,00   |   |
| 2 | 100,00 | 50,00    |   |
| 3 | 100,00 | 200,00   | x |
+---+--------+----------+---+

If B is twice the value of A then C should get a flag.

How should I do this?


Solution

  • Please try, in C1 and copied down to suit:

    =IF(B1=A1*2,"x","")