+ Reply to Thread
Results 1 to 10 of 10

How to use VLOOKUP to retrieve data based on a "Name" & "Date" query

  1. #1
    Registered User
    Join Date
    10-19-2018
    Location
    Lisbon
    MS-Off Ver
    Office 2013
    Posts
    16

    How to use VLOOKUP to retrieve data based on a "Name" & "Date" query

    Hello,

    Unfortunately I cannot seem to be able to do a VLOOKUP to match two criteria: Name and Date.

    In the file attached I need to add a formula under the "Main" sheet that fetches the number value of "Phone Productivity" from the "Phone Productivity" sheet - and the same for "Email Productivity".

    Is there a formula that enables me to acquire these productivity values based on "Date" and "Agent" at the same time?

    Thanks in Advance.
    Attached Files Attached Files

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,456

    Re: How to use VLOOKUP to retrieve data based on a "Name" & "Date" query

    In C2:

    =LOOKUP(2,1/('PHONE PRODUCTIVITY'!$A$2:$A$13=MAIN!A2)*('PHONE PRODUCTIVITY'!$B$2:$B$13=MAIN!B2),'PHONE PRODUCTIVITY'!$C$2:$C$13)

    In D2:

    =LOOKUP(2,1/('EMAIL PRODUCTIVITY'!$A$2:$A$13=MAIN!A2)*('EMAIL PRODUCTIVITY'!$B$2:$B$13=MAIN!B2),'EMAIL PRODUCTIVITY'!$C$2:$C$13)
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Forum Expert KOKOSEK's Avatar
    Join Date
    08-03-2018
    Location
    Pole in Yorkshire, UK
    MS-Off Ver
    365/2013
    Posts
    2,742

    Re: How to use VLOOKUP to retrieve data based on a "Name" & "Date" query

    Into C2 on Main tab:

    Please Login or Register  to view this content.
    into D2 on Main tab:

    Please Login or Register  to view this content.
    drag both formulas down as needed.


    p.s. You can also use array formulas like this (for phone):

    Please Login or Register  to view this content.
    (to accept with CSE) but I don't see the point.
    Happy with my answer * Add Reputation.
    If You are happy with solution, please use Thread tools and mark thread as SOLVED.

  4. #4
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: How to use VLOOKUP to retrieve data based on a "Name" & "Date" query

    Hi,

    This is clearly a much simplified example and probably doesn't represent the size of your actual data. We often find that when we give an answer to what is a trivial non representative example when the solution is used with the real world data it doesn't work because of factors like string length and other stuff which is important but hasn't been mentioned.

    That said it would be possible but why struggle with formulae when a Pivot Table with some slicers to filter and analyse it would be simpler, more elegant and useful.

    See attached. I've reformatted your Data and added a Pivot table sheet.
    Attached Files Attached Files
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  5. #5
    Registered User
    Join Date
    10-19-2018
    Location
    Lisbon
    MS-Off Ver
    Office 2013
    Posts
    16

    Re: How to use VLOOKUP to retrieve data based on a "Name" & "Date" query

    Thanks a bunch, I think this formula is the easiest for me to understand. This was a much simplified example, I now have to apply this logic to a different file.

  6. #6
    Forum Expert KOKOSEK's Avatar
    Join Date
    08-03-2018
    Location
    Pole in Yorkshire, UK
    MS-Off Ver
    365/2013
    Posts
    2,742

    Re: How to use VLOOKUP to retrieve data based on a "Name" & "Date" query

    Richard, you are right. It is good practice to use pivot tables in the case like this, but, to be honest, for so simple data (of course if, as you said, sample is not representative), I don't see the point to use Pivot, if 2 simple SUMIFS formulas do the job.

  7. #7
    Registered User
    Join Date
    10-19-2018
    Location
    Lisbon
    MS-Off Ver
    Office 2013
    Posts
    16

    Re: How to use VLOOKUP to retrieve data based on a "Name" & "Date" query

    Thank you Richard for your input!

    What I am trying to do is to build a Pivot Table from a Raw Data set which is composed of data from multiple sources.
    I was looking for a formula I could use to help assemble these. KOKOSEK's formula worked wonders, tried and tested. Cheers!

  8. #8
    Registered User
    Join Date
    10-19-2018
    Location
    Lisbon
    MS-Off Ver
    Office 2013
    Posts
    16

    Re: How to use VLOOKUP to retrieve data based on a "Name" & "Date" query

    Thanks AliGW, I need more time to understand the logic of "Lookup" (as opposed to VLookup). Cheers!

  9. #9
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,456

    Re: How to use VLOOKUP to retrieve data based on a "Name" & "Date" query

    It's dead simple. Think of it as a formulaic representation of a lookup table:

    =LOOKUP(lookup_value,lookup_array,result_array)

  10. #10
    Forum Expert KOKOSEK's Avatar
    Join Date
    08-03-2018
    Location
    Pole in Yorkshire, UK
    MS-Off Ver
    365/2013
    Posts
    2,742

    Re: How to use VLOOKUP to retrieve data based on a "Name" & "Date" query

    Am I incorrectly applied AliGW's formulas or it giving wrong results?

    edit: found double open/closed brackets missing (were singles)

    Please Login or Register  to view this content.
    Last edited by KOKOSEK; 04-08-2019 at 02:35 PM.

+ 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: 5
    Last Post: 02-05-2019, 12:03 AM
  2. [SOLVED] Column X-Ref list - Sheet1 Col A "pages", Col B:FL "Req" to Sheet2 ColA "req", ColB "page"
    By excel-card-pulled in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 04-07-2017, 09:30 AM
  3. Replies: 1
    Last Post: 01-22-2016, 09:21 AM
  4. Replies: 7
    Last Post: 11-08-2015, 03:57 PM
  5. Replies: 4
    Last Post: 11-17-2013, 12:05 PM
  6. [SOLVED] How to USE """"" cells count """"" change font color
    By austin123456 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-09-2013, 06:14 AM
  7. Return "green", "yellow" or "red" from date/age and priority ranking
    By Cantaloop in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-04-2013, 12:12 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