Home > Net >  Comparing every odd and even rows in excel
Comparing every odd and even rows in excel

Time:02-20

I have a very long column of strings in an excel file. I want to compare every odd and even row together. i.e to compare cells A1 and A2, then A3 and A4, then A5 and A6, etc. I do not want to split it into two separate worksheets, one containing odd number rows and the other one containing even row numbers. Any help on this, please?

CodePudding user response:

You can use the formula below. You start at row 2. Check if it is an even row then compare it with the above odd row

=IF(MOD(ROW(), 2)=0,A1=A2,"")

enter image description here

Update as requirement from comments, firstly, you have to insert the blank row for the formula to get value B1:

=IF(MOD(ROW(), 2)=0,A2=A3,B1)

enter image description here

  • Related