+ Reply to Thread
Results 1 to 3 of 3

Compare to columns and insert row different sheet

  1. #1
    Registered User
    Join Date
    12-04-2015
    Location
    Bulgaria,Razlog
    MS-Off Ver
    2013
    Posts
    2

    Compare to columns and insert row different sheet

    Two sheets. Both are almost the same, but in the sheet 2 is missing data. I want where the data is missing in sheet 2 to be fill with new row.
    Like that

    Sheet 1 Sheet 2
    A B A B
    1 ccc 1 ccc
    2 bbb 2 bbb
    3 aaa 4 eee
    4 eee
    Sheet 1 Sheet
    A B A B
    1 ccc 1 ccc
    2 bbb 2 bbb
    3 aaa 3 ___
    4 eee 4 eee

    PLS help becouse my brain will explode
    Last edited by spoon_009; 12-04-2015 at 09:28 AM.

  2. #2
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    6,274

    Re: Compare to columns and insert row different sheet

    In C2 of Sheet2, use the formula

    =MATCH(B2,Sheet1!B:B,FALSE)-1

    and copy down to match your data on sheet2.

    Then in the first empty cell of column C, use this array formula (entered using Ctrl-Shift-Enter), replacing the XXXs with the row number of the last row with data on sheet 2:

    =MIN(IF(ISNA(MATCH(ROW($C$2:CXXX)-1,$C$2:CXXX,0)),ROW($C$2:CXXX)-1,ROW()-1))

    Then copy that down for as many rows as you have on sheet 1.

    Then copy and paste values over column C, and sort your data based on column C ascending. Then delete column C
    Bernie Deitrick
    Excel MVP 2000-2010

  3. #3
    Registered User
    Join Date
    12-04-2015
    Location
    Bulgaria,Razlog
    MS-Off Ver
    2013
    Posts
    2

    Re: Compare to columns and insert row different sheet

    Thank you very much. It is not quite what i want ,but my explanation it is not very good. And you help me a lot with the idea.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Compare two columns on separate sheet, if missing, insert missing data
    By lilvictorians in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 04-03-2019, 11:44 PM
  2. Replies: 3
    Last Post: 12-15-2015, 05:04 PM
  3. Macro to compare columns and insert codes, according ranges
    By marina_lk in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-16-2013, 03:06 PM
  4. Compare two columns and insert codes, where it finds match with names
    By marina_lk in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-07-2013, 08:44 PM
  5. [SOLVED] Compare columns and insert values in correct place
    By HugoRibeiro in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 07-20-2013, 07:41 AM
  6. Replies: 4
    Last Post: 04-05-2012, 11:30 AM
  7. How to compare two pair columns and insert value from another column
    By dareme in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-27-2010, 01:08 AM
  8. Compare 2 sheet and insert result into other
    By sal21 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-31-2005, 11:50 AM

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.6.0 RC 1