+ Reply to Thread
Results 1 to 8 of 8

Vlookup or Match with Two Conditions in Excel Help

  1. #1
    Registered User
    Join Date
    11-09-2018
    Location
    Florida
    MS-Off Ver
    2013
    Posts
    31

    Vlookup or Match with Two Conditions in Excel Help

    Hello all,
    I would like to pull MKT info from table 2 into table 1 if both conditions (Account and Date in Table 1 Matched Table 2). I believe Vlookup can only do 1 condition. Any help would be greatly appreciated as this is a sample of 10,000 rows.

    So this example, I would like to pull in the MRK value of 858023.05 to Table 1 because Account (20600025522087) and Date (1/1/2012) matched in both table.

    TABLE 1
    ACCT DATE
    20600025522087 1/1/2012
    20600025522087 2/1/2012
    20600025522087 3/1/2012
    20600025522087 4/1/2012
    20750733737854 6/1/2015
    20750733737854 7/1/2015

    TABLE 2
    ACCT DATE PMKT MKT
    20600025522087 1/1/2012 840553.94 858023.05
    20600025522087 2/1/2012 858023.05 887728.18
    20600025522087 3/1/2012 887728.18 893642.31
    20600025522087 4/1/2012 893642.31 890349.76
    20600025522087 5/1/2012 890349.76 836927.99
    20600025522087 6/1/2012 836927.99 870952.61
    20600025522087 7/1/2012 870952.61 883830.70
    20600025522087 8/1/2012 883830.70 890491.72
    20750733737854 6/1/2015 .00 1386139.66
    20750733737854 7/1/2015 1386139.66 1430645.93
    20750733737854 8/1/2015 1430645.93 1333955.21
    20750733737854 9/1/2015 1333955.21 1259204.67
    20750733737854 10/1/2015 1259204.67 1326448.00
    20750733737854 11/1/2015 1326448.37 1319517.74Capture.PNG
    Last edited by lhp2019; 11-10-2018 at 02:08 PM.

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,884

    Re: Vlookup or Match with Two Conditions in Excel Help

    Will you please attach a sample Excel workbook? We are not able to work with or manipulate a picture of one and nobody wants to have to recreate your data from scratch.

    1. Make sure that your sample data are 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 results are also shown (mock up the results manually).

    3. Make sure that all confidential data is removed or replaced with dummy data first (e.g. names, addresses, E-mails, etc.).

    4. Try to avoid using merged cells as 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.

    Please pay particular attention to point 2 (above): without an idea of your intended outcomes, it is often very difficult to offer appropriate advice.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,080

    Re: Vlookup or Match with Two Conditions in Excel Help

    How about
    =INDEX(E3:H15,MATCH(A3&"|"&B3,E3:E15&"|"&F3:F15,0),4)

    ...confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer.

  4. #4
    Forum Expert José Augusto's Avatar
    Join Date
    10-29-2014
    Location
    Portugal
    MS-Off Ver
    2013-2016
    Posts
    3,329

    Re: Vlookup or Match with Two Conditions in Excel Help

    Or a regular forrmula

    =INDEX($H$3:$H$15,MATCH(A3&B3,INDEX($E$3:$E$15&$F$3:$F$15,,),0))

  5. #5
    Registered User
    Join Date
    11-09-2018
    Location
    Florida
    MS-Off Ver
    2013
    Posts
    31

    Re: Vlookup or Match with Two Conditions in Excel Help

    Sorry alansidman - I was trying to attach the sample actual data but when I click on the paper clip, I did not a place or icon for me to attach the file (new to the forum).

    José Augusto - This regular formula works - so one additional ask is if it matched how do I pull in two columns PMKT and MKT so I do not have to create two formulas?
    =INDEX($H$3:$H$15,MATCH(A3&B3,INDEX($E$3:$E$15&$F$3:$F$15,,),0))

    Thank you all so much!

  6. #6
    Registered User
    Join Date
    11-09-2018
    Location
    Florida
    MS-Off Ver
    2013
    Posts
    31

    Re: Vlookup or Match with Two Conditions in Excel Help

    I got it. I will copy the same formula below and just change for to say 3 to get the PMKT. Thank you everyone!!!

    =INDEX(E3:H15,MATCH(A3&"|"&B3,E3:E15&"|"&F3:F15,0),4)

  7. #7
    Forum Expert José Augusto's Avatar
    Join Date
    10-29-2014
    Location
    Portugal
    MS-Off Ver
    2013-2016
    Posts
    3,329

    Re: Vlookup or Match with Two Conditions in Excel Help

    You need one formula if the order is PMKT and MKT

    For PMKT and MKT down and forward range C3:D8

    =INDEX(G$3:G$15,MATCH($A3&$B3,INDEX($E$3:$E$15&$F$3:$F$15,,),0))
    Last edited by José Augusto; 11-10-2018 at 02:44 PM. Reason: Reference to A3&B3

  8. #8
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,080

    Re: Vlookup or Match with Two Conditions in Excel Help

    A non-array version of my solution would be
    =INDEX(E3:H15,MATCH(A3&"|"&B3,INDEX(E3:E15&"|"&F3:F15,,),0),3)
    and
    =INDEX(E3:H15,MATCH(A3&"|"&B3,INDEX(E3:E15&"|"&F3:F15,,),0),4)

+ 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. Replies: 8
    Last Post: 03-17-2016, 08:14 PM
  2. Splitting vlookup results if conditions don't match
    By Don Adeks in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-11-2015, 12:10 PM
  3. Replies: 2
    Last Post: 12-18-2014, 09:52 AM
  4. Replies: 4
    Last Post: 06-30-2014, 06:29 PM
  5. [SOLVED] Need help with vlookup/INDEX MATCH in getting a value using 2 different conditions
    By muheebrahman in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-30-2013, 06:44 AM
  6. Replies: 13
    Last Post: 12-13-2012, 11:44 AM
  7. Vlookup and If conditions together along with match
    By david_benjamin in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-11-2011, 10:00 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