+ Reply to Thread
Results 1 to 9 of 9

[Help] Lookup with Multiple Criteria

  1. #1
    Registered User
    Join Date
    02-13-2020
    Location
    Sao Paulo
    MS-Off Ver
    2016 (macOS)
    Posts
    12

    Exclamation [Help] Lookup with Multiple Criteria

    Hi!

    I need some help with looking up with multiple criteria, the reason for that is I need to use data from a pivot table with some lookup formula that considers 2 values (City and Product) in order to build a 'dynamic dashboard' with tables.

    It's quite hard to explain it by text, so I'll do my best using images:
    Image 2 (lookup).png

    (image 1) The table on the 'dashboard' sheet is supposed to fill up with information from the Pivot Table located on another sheet.
    • The B3 data (City) will be input by the user
    • The data on 'dashboard' table (C7:E10) needs to automatically filled depending on the B3 and pivot table data
    Image 1 (database).png

    So.. I tried to use INDEX MATCH, INDEX MATCH-MATCH with no avail
    Attached Files Attached Files

  2. #2
    Forum Expert wk9128's Avatar
    Join Date
    08-15-2020
    Location
    Taiwan
    MS-Off Ver
    365 V2403 and WPS V2022
    Posts
    3,382

    Re: [Help] Lookup with Multiple Criteria

    worksheet or Tab name : dashboard

    Cell C7 formula , Drag down and across

    Formula: copy to clipboard
    Please Login or Register  to view this content.

  3. #3
    Forum Expert
    Join Date
    02-10-2019
    Location
    Georgia, USA
    MS-Off Ver
    Office 365
    Posts
    2,824

    Re: [Help] Lookup with Multiple Criteria

    You'll probably get some good answers from people who use Pivot Tables a lot, but here's a solution without using the Pivot Table:

    =SUMIFS(Sales_Data[Quantity],Sales_Data[[City]:[City]],$B$3,Sales_Data[[Category]:[Category]],$B7)

    You can drag this across and down

  4. #4
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.84 for Mac MS 365
    Posts
    8,496

    Re: [Help] Lookup with Multiple Criteria

    for a different take on it, =SUMPRODUCT((FoodSales!$C$14:$C$245=dashboard!$B$3)*(FoodSales!$D$14:$D$245=dashboard!$B7),FoodSales!F$14:F$245)
    dragged down and across.
    Make contributors happy, click on the "* Add Reputation" as a way to say thank you.
    Sam Capricci

  5. #5
    Registered User
    Join Date
    02-13-2020
    Location
    Sao Paulo
    MS-Off Ver
    2016 (macOS)
    Posts
    12

    Exclamation Re: [Help] Lookup with Multiple Criteria

    I truly appreciate the quick answers!

    I might have forgotten a very important call out, the lookup formula needs to be applied on the pivot table.

    I wonder which formula would be the best to use with a pivot table with two columns with ~2500 rows of data each. This is why I'm trying to use a lookup formula to build the table on the dashboard. Unfortunately I can't use the pivot table per say, so I need to rely on this method to create the tables for the dashboard.

    Attachment 778093

    The SUMPRODUCT formula is an interesting one, but it didn't seem to work when I tested.
    I'll be very grateful if receive more ways to perform this search, since I need to test the SUMIFs provided here on the spreadsheet with the real data.

    Thanks again!
    Last edited by Sakrammentum; 04-25-2022 at 12:45 AM. Reason: Important Call out

  6. #6
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,986

    Re: [Help] Lookup with Multiple Criteria

    You said:

    "I might have forgotten a very important call out, the lookup formula needs to be applied on the pivot table."

    I say: Why?

    It is much easier to use the raw data to produce the dashboard that you want. Using the Pivot Table just makes simple formulae much more complicated.
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  7. #7
    Registered User
    Join Date
    02-13-2020
    Location
    Sao Paulo
    MS-Off Ver
    2016 (macOS)
    Posts
    12

    Re: [Help] Lookup with Multiple Criteria

    Hey Glenn,

    Maybe there’s a way to workaround the raw data in order to achieve what I need (or expect) and I’m not seeing it.

    The main issue with the raw data is that it’s filled with ~15 columns and rows that’ll easily reach and surpass 10.000 rows.

    The pivot table is helping with sorting, filtering data from highest to lowest products and let’s say, customer satisfaction ratings. So, there’s a lot of information to work with. As I said, maybe there’s a way to work with the raw data, but today I’m trying to deal with the pivot table, if that’s even possible.

  8. #8
    Valued Forum Contributor
    Join Date
    07-23-2013
    Location
    London, England
    MS-Off Ver
    Office 365
    Posts
    988

    Re: [Help] Lookup with Multiple Criteria

    Try this:

    C7=GETPIVOTDATA("Sum of Quantity",'pivot table'!$A$3,"City",$B$3,"Category",$B7)

    D7=GETPIVOTDATA("Sum of UnitPrice",'pivot table'!$A$3,"City",$B$3,"Category",$B7)

    E7=GETPIVOTDATA("Sum of TotalPrice",'pivot table'!$A$3,"City",$B$3,"Category",$B7)

    Then copy down to other rows. If a result might not be in the PivotTable then you can wrap it in IFERROR to avoid errors showing.

    PS Sum of Unit Price seems an unusual quantity to measure.

  9. #9
    Forum Expert wk9128's Avatar
    Join Date
    08-15-2020
    Location
    Taiwan
    MS-Off Ver
    365 V2403 and WPS V2022
    Posts
    3,382

    Re: [Help] Lookup with Multiple Criteria

    @Sakrammentum You're Welcome. Glad to help . Thank You for the feedback and rep.

    POST#5 The attachment provided is invalid, please upload again

+ 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. [SOLVED] Lookup multiple criteria in multiple columns in multiple rows; return true if exists
    By ufdlim in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 06-07-2019, 02:03 PM
  2. [SOLVED] Lookup to match multiple criteria and return multiple results excluding duplicates.
    By kris3012 in forum Excel Formulas & Functions
    Replies: 15
    Last Post: 01-13-2018, 11:06 AM
  3. Replies: 1
    Last Post: 09-04-2014, 12:14 PM
  4. Replies: 9
    Last Post: 08-20-2014, 04:43 PM
  5. Replies: 0
    Last Post: 10-16-2013, 12:42 PM
  6. Replies: 11
    Last Post: 02-07-2013, 02:22 AM
  7. Replies: 1
    Last Post: 05-16-2011, 05:00 PM

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