+ Reply to Thread
Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    07-05-2009
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    3

    Thumbs up How to compare Two worksheets and gerenerate differences in 3rd

    Hi,
    I am looking for someone to help with this excel task.
    I have two worksheets.
    Sheet1 is a Master List and Sheet2 is subset of Master List.
    Now I have to separate those records which are there in Master List, but not there is Sheet2 and list them in Sheet3.

    Example:
    Sheet1 contains records: a, b, c, d, e, f in rows
    Sheet2 contains records: a, d, e in rows
    Sheet3 must show: b, c, f in rows

    I need this done immediately, so any help would be appreciated.
    Thanks,
    Krishna Sastry
    Last edited by Krishna Sastry; 07-05-2009 at 01:42 PM. Reason: Great help from Domenic helped me solve my issue.

  2. #2
    Forum Guru
    Join Date
    06-18-2004
    Location
    Canada
    Posts
    1,287

    Re: How to compare Two worksheets and gerenerate differences in 3rd

    Maybe something like the following...

    Assumptions

    Sheet1!A2:A7 contains A, B, C, D, E, and F

    Sheet1!B2:E7 contains the corresponding data

    Sheet2!A2:A4 contains A, D, and E

    Sheet2!B2:E4 contains the corresponding data

    Formulas

    Sheet1!F1: 0

    (Enter a zero in F1.)

    Sheet1!F2, and copied down:

    =IF(A2<>"",IF(ISNA(MATCH(A2,Sheet2!$A$2:$A$4,0)),LOOKUP(9.99999999999999E+307,Sheet1!$F$1:F1)+1,""), "")

    Sheet3!A2:

    =LOOKUP(9.99999999999999E+307,Sheet1!F1:F7)

    Sheet3!B2, copied across and down:

    =IF(ROWS(B$2:B2)<=$A$2,LOOKUP(ROWS(B$2:B2),Sheet1!$F$2:$F$7,Sheet1!A$2:A$7),"")

    See sample file attached...
    Attached Files Attached Files
    Domenic
    Microsoft MVP - Excel
    xl-central.com, "Your Quick Reference to Excel Solutions"

  3. #3
    Registered User
    Join Date
    07-05-2009
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    3

    Thumbs up Re: How to compare Two worksheets and gerenerate differences in 3rd

    Hi Domenic,
    That's brilliant. It worked. Thanks a lot for your timely help. I was trying with LOOKUP functions for quite some time, but no luck.
    I understood your logic except that 9E+307 thing, can you shed some light on this please. I think this is what made the difference.
    Regards,
    Krishna Sastry

  4. #4
    Forum Guru
    Join Date
    06-18-2004
    Location
    Canada
    Posts
    1,287

    Re: How to compare Two worksheets and gerenerate differences in 3rd

    You're very welcome! The following number...

    9.99999999999999E+307

    ...is the largest number recognized by Excel. When used as a lookup value, LOOKUP returns the last numerical value in the lookup range.
    Domenic
    Microsoft MVP - Excel
    xl-central.com, "Your Quick Reference to Excel Solutions"

  5. #5
    Registered User
    Join Date
    07-05-2009
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    3

    Lightbulb Re: How to compare Two worksheets and gerenerate differences in 3rd

    Thanks for that one, Domenic.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.2.0