+ Reply to Thread
Results 1 to 10 of 10

Match Columns & If True Copy Row - How?

  1. #1
    Registered User
    Join Date
    05-10-2013
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    31

    Match Columns & If True Copy Row - How?

    Hi, I have a list with multiple unique numbers and then a list with a single corresponding unique number but next to the single entries are the surnames and forenames. I want to copy them over to the mulitple entry fields. For example:

    Enrol Ref No Surname First Forename
    0305526 0305526 ISMAIL AWRENG
    0305526 0503253 ZAHID SOHAIL
    0305526 0509352 HOLTEN THOMAS
    0305526 0608249 BROWN REBECCA
    0305526 0702933 BELLWOOD PAIGE
    0305526 0703808 CARROLL GEORGINA
    0305526 0704205 GARTERY JORDAN
    0374016 0708721 HAHAA KAREM SARAH QADER
    0374770 0708907 SHARIF KARWAN
    0503253 0708916 MOHAMMED TALAR
    0503253 0800413 BROOKS LEONA
    0503253 0800420 BEAUMONT MICHAEL
    0503253 0800501 CLAYTON JASMIN
    0503253 0802033 HALLSWORTH KRISTIAN


    A = Enrol
    B = Blank
    C = Blank
    D = Ref No
    E = Surname
    F = Forename

    I want A to match D and where it does match D I want it to copy the row for E and F next to it on to B and C. In other words in the example above (and attached) A2 to A8 matches D2, how do I then get it to copy E2 and F2 over to B2-B8 and C2-C8.

    How do I do that? I'll attach a small sample as the actual one runs in the thousands.

    Sample.xlsx
    Last edited by thussain; 05-22-2013 at 06:21 AM.

  2. #2
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Match Columns & If True Copy Row - How?

    Perhaps in B2. Copy down and across to C2 this ARRAY formula.

    =IFERROR(INDEX(E$2:E$15,SMALL(IF($D$2:$D$15=$A2,ROW(E$2:E$15)-1),ROW(E$1))),"no match")
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  3. #3
    Registered User
    Join Date
    05-10-2013
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    31

    Re: Match Columns & If True Copy Row - How?

    Thanks Fotis but that doesn't work. The first entry repeats itself seven times therefore I need a formula which will pick that up and copy the name over seven times because it matches seven times. The formulas you gave seems to just copy them over in order rather than match and then copy.

    In other words A2 all the way to A8 has the same enrol number of 0305526. I want the formula to see that this number exists in D2 therefore I want it to copy what is next to D2 i.e. E2 and F2 in to what is next to A2-A8 i.e. B2-B8 and C2-C8. Am I making sense?

    A2-A15 and B2-B15 and C2-C15 should look like this:

    0305526 ISMAIL AWRENG
    0305526 ISMAIL AWRENG
    0305526 ISMAIL AWRENG
    0305526 ISMAIL AWRENG
    0305526 ISMAIL AWRENG
    0305526 ISMAIL AWRENG
    0305526 ISMAIL AWRENG
    0374016 No Match No Match
    0374770 No Match No Match
    0503253 ZAHID SOHAIL
    0503253 ZAHID SOHAIL
    0503253 ZAHID SOHAIL
    0503253 ZAHID SOHAIL
    0503253 ZAHID SOHAIL
    Last edited by thussain; 05-22-2013 at 06:36 AM.

  4. #4
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Match Columns & If True Copy Row - How?

    What is this that i am missing?

    Formula does what you describe.
    Attached Files Attached Files

  5. #5
    Forum Expert
    Join Date
    12-11-2011
    Location
    Netherlands
    MS-Off Ver
    office 365
    Posts
    3,293

    Re: Match Columns & If True Copy Row - How?

    Why not this simple (not array) formula?
    Please Login or Register  to view this content.
    Willem
    English is not my native language sorry for errors
    Please correct me if I'm completely wrong

  6. #6
    Registered User
    Join Date
    05-10-2013
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    31

    Re: Match Columns & If True Copy Row - How?

    You're right... I think I copied it wrong by just dragging it down. Thanks! +Rep

  7. #7
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Match Columns & If True Copy Row - How?

    Quote Originally Posted by popipipo View Post
    Why not this simple (not array) formula?
    Please Login or Register  to view this content.
    Correct! No reason. Regular formula.

    =IFERROR(INDEX(E$2:E$15,MATCH($A2,$D$2:$D$15;0)),"no match")

  8. #8
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Match Columns & If True Copy Row - How?

    Quote Originally Posted by thussain View Post
    You're right... I think I copied it wrong by just dragging it down. Thanks! +Rep
    You just didn't confirm the formula as ARRAY. See my signature.

    But in any case you don't need the ARRAY formula. See posts #5 and #7!

  9. #9
    Registered User
    Join Date
    05-10-2013
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    31

    Re: Match Columns & If True Copy Row - How?

    ^ it says the formula in #5 and #7 has an error? But I'm using you array anyway, it does the job, thanks!
    Last edited by thussain; 05-22-2013 at 07:03 AM.

  10. #10
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Match Columns & If True Copy Row - How?

    ............................
    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)

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