# Compare contents of two rows

#### JCScoobyRS

##### Board Regular
I need to be able to take two rows, let's say A and B, and see what numbers that aren't in A that are in B and numbers that are in B that aren't in A. How would you suggest doing this? A simple loop would work but does Excel do anything like this? Thanks, Jeremy

### Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).

##### MrExcel MVP
having performed the comparison, what kind of result / output do you want? "...see what numbers..." isn't really specific enough - give an example.

#### JCScoobyRS

##### Board Regular
I just need to know which values are in Column A that aren't in Column Be and vice versa. As far as the output...I really don't mind as long as the output would make sense. Thanks, Jeremy

#### JCScoobyRS

##### Board Regular
TryingToLearn,
Thanks. I will do some research myself too. Thanks, Jeremy

#### Yogi Anand

##### MrExcel MVP
JCScoobyRS said:
I need to be able to take two rows, let's say A and B, and see what numbers that aren't in A that are in B and numbers that are in B that aren't in A. How would you suggest doing this? A simple loop would work but does Excel do anything like this? Thanks, Jeremy
Hi JCScoobyRS:

I don't know the context in which you are trying to do this -- however, in the following illustration, I have not limited the comparison to numbers only -- I am going to compare both numeric and text entries. I am going to locate which non-blank entry in row 3 does not match any entry in row 2
y040222h1a.xls
ABCDEFGHIJ
2b237
30252a
410   6 0 10
5columnnumberwheretheentryinrow3doesnotmatchanentryinrow2
600   5 0 a
7entryinrow3inthedesignatedcolumnnumberdoesnotmatchanyentryinrow2
Sheet3

Would this do?

Replies
9
Views
153
Replies
2
Views
112
Replies
1
Views
137
Replies
9
Views
159
Replies
1
Views
115

1,186,924
Messages
5,960,584
Members
438,486
Latest member
ncc84330

### We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.

### Which adblocker are you using?

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

### Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

### Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back