+ Reply to Thread
Results 1 to 5 of 5

Vlookup, Max, SumProduct...HELP with formula!

  1. #1
    Registered User
    Join Date
    05-24-2013
    Location
    Atlanta, GA
    MS-Off Ver
    Excel 2010
    Posts
    2

    Post Vlookup, Max, SumProduct...HELP with formula!

    Here is my dilemma. I have a pivot table which has a customer number in column A, customer group in column B, and the amount spent per customer per group in column C. On my nonpivot worksheet, I want to look up the customer number from the pivot table and pull the value from the customer group column but based on the max value of the amount groupings for the customer number.

    Example
    Customer Number, Customer Group, Amount
    1,145,5000
    1,125,1000
    1,100,6000

    So for customer number 1, the result would pull in 100 because it is associated with the highest amount among the group numbers. Does this make sense? PLEASE HELP! I have tried to figure this out for two days. I can't get it. I am also open to changing pivot table into text and copying to non-pivot worksheet for ease of calculation.

  2. #2
    Registered User
    Join Date
    04-22-2013
    Location
    The Netherlands
    MS-Off Ver
    Excel 2003/2007 & 2010
    Posts
    90

    Re: Vlookup, Max, SumProduct...HELP with formula!

    Problem with VLOOKUP in this setup is that it keeps finding the first entry, and then stops.

    I'd suggest two options (both manipulating your pivot table) to achieve what you want:
    1. Sort the customer group based on the amount (high to low). This way VLOOKUP always finds the highest group for a customer and returns that row.
    2. Similar to 1: filter the top 1 of a customer group based on amount

    Will this help you on your way?

  3. #3
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Vlookup, Max, SumProduct...HELP with formula!

    Try this...

    With your data in the range A2:C4.

    This array formula**:

    =INDEX(B2:B4,MATCH(1,IF(A2:A4=1,IF(C2:C4=MAX(IF(A2:A4=1,C2:C4)),1)),0))


    ** array formulas need to be entered using the key
    combination of CTRL,SHIFT,ENTER (not just ENTER).
    Hold down both the CTRL key and the SHIFT key
    then hit ENTER.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  4. #4
    Registered User
    Join Date
    05-24-2013
    Location
    Atlanta, GA
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Vlookup, Max, SumProduct...HELP with formula!

    I never thought of that. MANY THANKS!

  5. #5
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Vlookup, Max, SumProduct...HELP with formula!

    Quote Originally Posted by ellyndee View Post
    I never thought of that. MANY THANKS!
    Can't tell who you're replying to.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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