+ Reply to Thread
Results 1 to 7 of 7

Need formulas to find and copy maching cells

Hybrid View

  1. #1
    Registered User
    Join Date
    05-05-2017
    Location
    Lithuania
    MS-Off Ver
    2016
    Posts
    4

    Need formulas to find and copy maching cells

    Hello,

    I need a big help. I have excel file with two sheets in it ( Sheet1 and Sheet2 )
    I need to compare Sheet1 A1 with Sheet2 C10:100 and if there are any duplicates than copy all row (with duplicate cell) from Sheet 1 and Sheet 2 to New Sheet 3, and same is with Sheet 1 A2, A3 till A500

    In simple if Sheet 1 column A1 is same as Sheet 2 column C50 then copy all row with column A1 ( Sheet 1 ) and all row with column C50 ( Sheet 2 ) to Sheet 3 A1 and A2 rows

    Thank you very much.
    Last edited by EdvinasS; 05-05-2017 at 03:41 AM.

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Need formulas to find and copy maching cells

    Will you please attach a SMALL sample Excel workbook (10-20 rows of data is usually enough)? Please don't attach a picture of one (no-one will want to re-type all your stuff before starting).

    1. Make sure that your sample data are truly REPRESENTATIVE of your real data. The use of unrepresentative data is very frustrating and can lead to long delays in reaching a solution.

    2. Make sure that your desired solution is also shown (mock up the results manually).

    3. Make sure that all confidential information is removed first!!

    4. Try to avoid using merged cells. They cause lots of problems!

    Unfortunately the attachment icon doesn't work at the moment. So, to attach an Excel file you have to do the following: Just before posting, scroll down to Go Advanced and then scroll down to Manage Attachments. Now follow the instructions at the top of that screen.
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

  3. #3
    Registered User
    Join Date
    05-05-2017
    Location
    Lithuania
    MS-Off Ver
    2016
    Posts
    4

    Re: Need formulas to find and copy maching cells

    Attached.

    Thanks.
    Attached Files Attached Files

  4. #4
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Need formulas to find and copy maching cells

    I think I understand what ypu want.. but rather than leave me guessing, please amend your sheet to show what your anticipated results are. I don't fully understand your written description.

  5. #5
    Registered User
    Join Date
    05-05-2017
    Location
    Lithuania
    MS-Off Ver
    2016
    Posts
    4

    Re: Need formulas to find and copy maching cells

    I'll showed that i found one and another one duplicates in sheet 1 and 2 and copied these two lines to sheet 3, i done it by hand, but i need formula. I was tryink vlookup match counfit but i really miss info in my head by using larger formulas in excel than sum or count

    Thanks a lot
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    05-05-2017
    Location
    Lithuania
    MS-Off Ver
    2016
    Posts
    4

    Re: Need formulas to find and copy maching cells

    Hello, so could any help with this question?

    Thank you

  7. #7
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Need formulas to find and copy maching cells

    Apols. I've been away. These are all array formulae:

    To return the duplicate data from sheet 1, copied across and down:
    =IFERROR(INDEX(Sheet1!A:A,SMALL(IF(ISNUMBER(MATCH(Sheet1!$A$1:$A$12,Sheet2!$C$10:$C$21,0)),ROW(Sheet1!$A$1:$A$12)),ROWS(A$7:A7))),"")

    To return the duplicate data from sheet 2, copied across and down:
    =IFERROR(INDEX(Sheet2!A:A,SMALL(IF(ISNUMBER(MATCH(Sheet2!$C$10:$C$21,Sheet1!$A$1:$A$12,0)),ROW(Sheet2!$C$10:$C$21)),ROWS(A$14:A14))),"")

    They can be combined to return the data on alternate rows, but it is more complicated again!! Use this, copied across and down.

    Formula: copy to clipboard
    =IFERROR(IF(ISODD(ROWS(H$7:H7)),INDEX(Sheet1!A:A,SMALL(IF(ISNUMBER(MATCH(Sheet1!$A$1:$A$12,Sheet2!$C$10:$C$21,0)),ROW(Sheet1!$A$1:$A$12)),1+INT((ROWS(H$7:H7)-1)/2))),INDEX(Sheet2!A:A,SMALL(IF(ISNUMBER(MATCH(Sheet2!$C$10:$C$21,Sheet1!$A$1:$A$12,0)),ROW(Sheet2!$C$10:$C$21)),1+INT((ROWS(H$7:H7)-1)/2)))),"")


    Array Formulae are a little different from ordinary formulae in that they MUST be confirmed in the FIRST CELL ONLY by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. After that, the array can be dragged down as normal, to cover the desired range.

    You will know the array is active when you see curly brackets { } - or "curly braces" for those of you in the USA, or "flower brackets" for those of you in India - appear around the outside of your formula. If you do not use CTRL+SHIFT+ENTER you will (almost always) get an error message or an incorrect answer. Press F2 on that cell and try again.

    Don't type the curly brackets yourself - it won't work...

    Take the formulae from the sheet, as they'll have the , and ; correct for your country.
    Attached Files Attached Files

+ 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. maching item from main data tab and picking correct $ amount
    By Ninocka in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 03-10-2016, 04:56 PM
  2. [SOLVED] How can I use .find() to find values (not formulas of cells)?
    By vizzkid in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-01-2014, 08:56 AM
  3. How find the last maching data
    By zabaki in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-19-2013, 01:58 AM
  4. Replies: 5
    Last Post: 11-03-2012, 05:10 PM
  5. [SOLVED] Moving columns based on maching info in each file
    By djfscouse in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-13-2012, 09:56 AM
  6. [SOLVED] Find Maching in the Excel
    By Alan Tang in forum Excel General
    Replies: 3
    Last Post: 12-26-2005, 08:15 AM
  7. Maching lists and removing maches
    By mrynit in forum Excel General
    Replies: 1
    Last Post: 05-14-2005, 06:53 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