When performing data analysis in Excel, one of the most frequent tasks is comparing data in each individual row. This task can be done by using the IF function.
To compare two columns in Excel row-by-row, write a usual IF formula that compares the first two cells. Enter the formula in some other column in the same row, and then copy it down to other cells by dragging the fill handle (a small square in the bottom-right corner of the selected cell). As you do this, the cursor changes to the plus sign:
To find cells within the same row having the same content, A2 and B2 in this example, the formula is as follows:
To find cells in the same row with different content, simply replace “=” with the non-equality sign:
And of course, nothing prevents you from finding both matches and differences with a single formula:
The result may look similar to this:
As you see, the formula works well with dates, numbers, test and time.