Avatar of SMadhavi
SMadhavi
Flag for Canada asked on

eXCEL COMPARISON SIMPLIFIED

I have two sheets

sheet1 has col1, col2, col3, col4

and

Sheet2 has col1, col2, col3, col4

The data in both the sheets is sorted as col2, col1

I want to run a comparison on two sheets, I want find the records missing in sheet2 that are present in sheet 1

We need to comapre col1

Example of data in sheet 1

col1, col2, col3, col4
a.b    d         1      1
d.c    d          2      1
E.F    D
w.s   e    
e.d    e           1     1


Example of sheet2
col1, col2, col3, col4
a.b    d         1      1
w.s   e    


FINAL SHEET1 SHOULD LOOK LIKE THIS
col1, col2, col3, col4  COL5
a.b    d         1      1
d.c    d          2      1     MISSING
E.F    d                         MISSING
w.s   e    
e.d    e           1     1    MISSING



pLEASE NOTE i AM NOW COMPARING ONLY cOL1 FROM SHEET1 TO COL1 FROM SHEET2
No idea how to do it in excel.
Microsoft Excel

Avatar of undefined
Last Comment
dlmille

8/22/2022 - Mon
dlmille

To compare the entire record from A:E - You can use an array function like this (in column e on sheet1, say E2):

[E2]=IF(ISERROR(MATCH($A2&$B2&$C2&$D2,Sheet2!$A$2:$A$100&Sheet2!$B$2:$B$100&Sheet2!$C$2:$C$100&Sheet2!$D2:$D100,0)),"MISSING","")

Hit CTRL-SHIFT-ENTER to confirm array.  Then, you can copy down.

And E2 on Sheet2:

[E2]=IF(ISERROR(MATCH($A2&$B2&$C2&$D2,Sheet1!$A$2:$A$100&Sheet1!$B$2:$B$100&Sheet1!$C$2:$C$100&Sheet1!$D$2:$D$100,0)),"MISSING","")

Hit CTRL-SHIFT-ENTER to confirm array.  Then, you can copy down.

The formula supports values from row 2 to 100.  Just change the 100 to a larger number if you're working with larger datasets, or use A:A, B:B, C:C, D:D for the entire sheet (though, that makes for additional processing cost).

See attached demonstrated solution.

Dave
excelComparison-r1.xls
ASKER CERTIFIED SOLUTION
dlmille

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes