+ Reply to Thread
Results 1 to 5 of 5

Matching columns and outputting lists of corresponding values

  1. #1
    Registered User
    Join Date
    06-29-2010
    Location
    Hawaii, USA
    MS-Off Ver
    Excel 2007
    Posts
    4

    Exclamation Matching columns and outputting lists of corresponding values

    Hi, all. I'm new and am stuck with a problem in Excel 2007 with a lot of information (45,000 to 60,000 rows). Here's my problem:

    From one machine, I have the date, hour, minute, second, and a measured numerical value, and from another machine, I also have the date, hour, minute, second, and a measured numerical value.

    Whenever both machines took a measurement on the same day, at the same time (same hour, minute, and second), I need to know the corresponding numbers that both machines measured. I have an example below.

    First machine (columns A-E):

    Date Hour Min Sec Number
    2009-09-22 0 14 39 90
    2009-09-22 10 37 11 36
    2009-09-22 11 55 15 42
    2009-09-22 12 6 36 21
    2009-09-22 13 18 58 96
    2009-09-22 13 49 45 68
    2009-09-22 15 1 46 93
    2009-09-23 6 13 27 38
    2009-09-23 18 21 52 27
    2009-09-23 18 39 0 91
    2009-09-23 20 16 17 26


    Second machine (columns G-K):

    Date Hour Min Sec Number
    2009-09-22 5 59 39 18
    2009-09-22 9 3 17 9
    2009-09-22 10 8 41 39
    2009-09-22 11 55 15 61
    2009-09-23 13 15 58 28
    2009-09-23 13 12 56 66
    2009-09-23 15 1 46 48
    2009-09-23 20 16 17 2
    2009-09-24 18 21 38 31
    2009-09-24 23 34 0 78
    2009-09-25 3 1 58 46
    2009-09-25 14 34 7 75
    2009-09-25 14 59 26 57


    Ideal output would be this:

    42 61
    26 2


    I tried to make it as similar to my file as possible. One machine has more measurements than the other, so the lists are longer. Also, there may be more measurements taken on one day for the first machine, but less measurements taken on the same day by the other machine, so dates and times will not match up next to each other in rows.

    Thank you so much if anyone can help! I've been working on this file for practically 7 hours every day since last Thursday.
    Last edited by eila90; 07-09-2010 at 03:23 AM. Reason: solved

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Matching columns and outputting lists of corresponding values

    Try this:

    Insert a column between the 2 tables so that the second table now starts in column H.

    In F2 enter formula:

    =A2+TIME(B2,C2,D2) and copy down (this make the date and time in one cell)

    in M2, similar formula:

    =H2+TIME(I2,J2,K2) copied down

    in G2 enter formula:

    =IF(ISNUMBER(MATCH(F2,M:M,0)),COUNT(G$1:G1)+1,"") copied down

    This compares value in F with values in M and returns a consecutive count of matches.

    similar formula in N2:

    =IF(ISNUMBER(MATCH(M2,F:F,0)),COUNT(N$1:N1)+1,"") copied down

    Then in new column, say P1 enter:

    =MAX(G:G)

    and in Q1:

    =MAX(N:N)

    these give counts of matches for each set.

    then in P2:

    =IF(ROWS($A$1:$A1)>$P$1,"",INDEX(E:E,MATCH(ROWS($A$1:$A1),$G:$G,0)))

    and in Q2:

    =IF(ROWS($A$1:$A1)>$Q$1,"",INDEX(L:L,MATCH(ROWS($A$1:$A1),$N:$N,0)))

    both copied down as far as you want...

    these return the numbers at the matching points.
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Registered User
    Join Date
    06-29-2010
    Location
    Hawaii, USA
    MS-Off Ver
    Excel 2007
    Posts
    4

    Exclamation Re: Matching columns and outputting lists of corresponding values

    Thanks so much for both of your responses. I tried following your instructions, NBVC, but for some reason it did not work. I've attached a dummy worksheet with sample data, and provided some highlighting to indicate what I'm looking for. The results are in columns M and N.

    Again, what I'm trying to do is this:

    If machine A and machine B took a measurement at the same date and time, I need that particular measurement machine A took and that particular measure that machine B took.

    Thank you in advance to anyone who may be able to help me! I'm very much so stuck on how to do this.
    Attached Files Attached Files

  4. #4
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Matching columns and outputting lists of corresponding values

    Here is your book back with my exact instructions added...

    See results in P and Q columns.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    06-29-2010
    Location
    Hawaii, USA
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Matching columns and outputting lists of corresponding values

    Thanks so much! It worked!!!

+ 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