+ Reply to Thread
Results 1 to 4 of 4

Matching two columns....

  1. #1
    Registered User
    Join Date
    09-11-2015
    Location
    Salt Lake city Utah
    MS-Off Ver
    2010
    Posts
    36

    Matching two columns....

    I will do my best to explain... I am pulling data from two databases via SQL --

    In both data sets, there's a Date column, and Phone Extension column.

    I need to look up values from data set one, and match them to data set two, to bring in the data from data set two, to marry the two.... hope this makes sense.

    The attached PIC should help - the column highlighted yellow under data set two, is the data I need to marry to data set one, using the date and ext columns..

    Example.JPG

  2. #2
    Valued Forum Contributor loginjmor's Avatar
    Join Date
    01-31-2013
    Location
    Cedar Rapids, Iowa
    MS-Off Ver
    Excel 2013
    Posts
    1,073

    Re: Matching two columns....

    Hi -

    Are there any repeats? For example, two or more entries of the same date and same extension?
    ____________________________________________
    If this has solved your problem, please edit the thread title to add the word [SOLVED] at the beginning. You can do this by
    -Go to the top of the first post
    -Select Thread Tools
    -Select Mark thread as Solved

    If I have been particularly helpful, please "bump" my reputation by pressing the small star in the lower left corner of my post.

  3. #3
    Registered User
    Join Date
    09-11-2015
    Location
    Salt Lake city Utah
    MS-Off Ver
    2010
    Posts
    36

    Re: Matching two columns....

    No, there are not -

    Date And Ext, will not be repeated for the same date anyway..

    Example,

    12/31/16 645 may be repeated on the line below, but under a different date.
    01/01/17 645
    01/02/17 645

    Hope this makes sense.

  4. #4
    Valued Forum Contributor loginjmor's Avatar
    Join Date
    01-31-2013
    Location
    Cedar Rapids, Iowa
    MS-Off Ver
    Excel 2013
    Posts
    1,073

    Re: Matching two columns....

    I would try the following:
    =INDEX($G$3:$G$5,SUMPRODUCT((A3=$E$3:$E$5)*(B3=$F$3:$F$5)*ROW())-2)

    This assumes the data in your picture above starts at Cell A3 (the first date of Data Set 1). That's important because the ROW() function gives you the absolute row number where SUMPRODUCT determines both criteria match. INDEX uses the Relative row number starting at the top of the data set (in this case, INDEX treats Cell A3 as Row 1 of the data set), but ROW() will return the row of cell A3 as 3. So, to get SUMPRODUCT to return the Relative row number that makes sense to INDEX, I have to subtract 2 from ROW(). So, if your data actually starts in Cell G10, then I have to subtract 9 from ROW(). Make sense?

    Hope this helps.

+ 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. matching 2 columns to 2 columns to display price from 3rd col
    By razer1 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 12-27-2015, 03:41 PM
  2. Replies: 2
    Last Post: 05-02-2015, 10:49 AM
  3. [SOLVED] Align 3 columns with 2 columns of matching data
    By loritee in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-23-2013, 10:36 AM
  4. Replies: 2
    Last Post: 04-18-2013, 05:56 PM
  5. Replies: 3
    Last Post: 06-09-2011, 05:58 AM
  6. sort columns based on matching 1st & 2nd columns
    By repke in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 02-13-2011, 01:37 PM
  7. compare columns and count number of matching columns
    By san000 in forum Excel General
    Replies: 1
    Last Post: 07-15-2009, 10:31 PM

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