+ Reply to Thread
Results 1 to 7 of 7

Lining up data with two colums of unequal length

Hybrid View

  1. #1
    Registered User
    Join Date
    02-22-2016
    Location
    US
    MS-Off Ver
    10
    Posts
    6

    Lining up data with two colums of unequal length

    Hello,

    I have attached an excel file for clarity. Here is what I am trying to do:

    I have serial numbers in columns C and E (keep in mind this is a sample sheet and actual data is over 600 entries). I want to match up the serial numbers in column C with column E. Also, when I do this I want the corresponding model/color info from column F and G to stay with the serial number.

    I don't know if this matters but column E is longer than column C and therefore some numbers will not have a match. I don't know how this will affect things. There are no duplicate serial numbers.

    I have provided a sample sheet to show what I am trying to do. Any help is needed! I have been trying to figure this out for a while so I am seeking help!

    Thanks!
    Attached Files Attached Files

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Lining up data with two colums of unequal length

    1) Remove the two rows so the headers are in row1, data starts in row2

    2) Remove the second table down below so only the wanted data is there.

    3) Over in H2 put this formula:

    =IFERROR(INDEX(E:E, MATCH($C2,$E:$E, 0)), "")

    ......and copy that cell down and across through J7.


    Now you have the wanted results on the right, you can copy them and PASTE SPECIAL > VALUES over the original columns D:F.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    02-22-2016
    Location
    US
    MS-Off Ver
    10
    Posts
    6

    Re: Lining up data with two colums of unequal length

    that worked. However, the data on the right that didn't match up has been deleted. How do I fix this? I want all the data to remain
    even if there is not a match

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Lining up data with two colums of unequal length

    Your example didn't show that. In that case I would not recommend copying the results over the original.

  5. #5
    Registered User
    Join Date
    02-22-2016
    Location
    US
    MS-Off Ver
    10
    Posts
    6

    Re: Lining up data with two colums of unequal length

    Ok. Does anyone have any suggestions?

    Again, the column of serial numbers on the left is longer than the column on the right by about 25 numbers. The numbers that don't
    match up, I still want them in the worksheet. Maybe just at the end?? I don't care where they are so much, but they must still be in
    the data set.

    The file I submitted was just an example- real data contains 600+ entries

  6. #6
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Lining up data with two colums of unequal length

    My apologies, I am simply going by the exact representation from your second "What I want" table which does not show unmatched items. From a formula standpoint the solution given provides that.

    So, a longer manual method:

    1) Insert these formulas

    H2: =IF(ISNUMBER(MATCH(E2,C:C, 0)), H1, H1+1) ...copied down
    I2: =IFERROR(INDEX(E:E, MATCH($C2,$E:$E, 0)), "")...copied down and across through column K

    M1: =MAX(H:H)
    M2: =IF(ROW(A1)>$M$1, "", INDEX(E:E, MATCH(ROW(A1),$H:$H, 0))) ...copied across through O2, then copied DOWN until blanks appear


    2) Copy M:O and PasteSpecial>Values over itself to remove the formulas and keep the results

    3) Copy I2:K?? and PastSpecial>Values over the original values in E:G

    4) Copy the Extra items listed in O:P and paste at the bottom of E:G

    5) Clear the helper columns.

  7. #7
    Registered User
    Join Date
    02-22-2016
    Location
    US
    MS-Off Ver
    10
    Posts
    6

    Re: Lining up data with two colums of unequal length

    That worked!!

    Thank you!

+ 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. Lining up data from two different files
    By hk106 in forum Excel General
    Replies: 4
    Last Post: 08-30-2012, 01:16 PM
  2. How to Match and fill two lists of unequal length
    By artaxerxes in forum Excel General
    Replies: 6
    Last Post: 01-24-2012, 04:21 PM
  3. lining up data
    By Compton2004 in forum Excel General
    Replies: 1
    Last Post: 12-17-2008, 08:03 PM
  4. Lining Up Column Data
    By inwalkedbud in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-17-2008, 11:51 AM
  5. [SOLVED] Series with noncontiguous unequal length data?
    By Bob@1800-mail.com in forum Excel Charting & Pivots
    Replies: 3
    Last Post: 06-15-2006, 01:25 PM
  6. Lining up data from concatenation
    By Some Dude in forum Excel General
    Replies: 8
    Last Post: 06-05-2006, 02:35 PM
  7. Lining up data from concatenation
    By Some Dude in forum Excel General
    Replies: 10
    Last Post: 06-05-2006, 02:35 PM
  8. Lining up data from two sheets
    By JoeZ in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-14-2005, 10:25 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