+ Reply to Thread
Results 1 to 10 of 10

Double Variable Lookup (Think SUMPRODUCT would work)

  1. #1
    Registered User
    Join Date
    09-09-2006
    MS-Off Ver
    Excel (Office 365 ProPlus)
    Posts
    47

    Double Variable Lookup (Think SUMPRODUCT would work)

    All

    In essence this problem has three parts.

    1 the input. Here line items costs are submitted which need to be "paid for" and split by 5 different businesses.

    2 the businesses need to pay in different shares depending on a "key". This is static in a lookup table.

    3 the output. I need to see per line item category, the total each business needs to pay after their % split has been summed up.

    As always have tried to mockup the data, and the expected outcome. Allocation Key Lookup.xlsx

    Appreciate the advise/any solutions

    Jay

  2. #2
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Double Variable Lookup (Think SUMPRODUCT would work)

    I don't have time to search this but looks that this formula to P4 and copy across works.

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

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  3. #3
    Registered User
    Join Date
    09-09-2006
    MS-Off Ver
    Excel (Office 365 ProPlus)
    Posts
    47

    Re: Double Variable Lookup (Think SUMPRODUCT would work)

    Thanks for the reply. Appreciate you taking the time.

    I have tried and although it works for the first line, doesnt give any results when I drag it down to Category B and C

    Also if I change the Key from 1 to 2 (in D4) for the first line item, it seems to not give any results anymore

    Jay

  4. #4
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Double Variable Lookup (Think SUMPRODUCT would work)

    Maybe this solution will work for you. I created totals for each category and key per business then summarized the data using SUBTOTAL and also a Pivot Table.
    Attached Files Attached Files
    <---------If you like someone's answer, click the star to the left of one of their posts to give them a reputation point for that answer.
    Ron W

  5. #5
    Registered User
    Join Date
    09-09-2006
    MS-Off Ver
    Excel (Office 365 ProPlus)
    Posts
    47

    Re: Double Variable Lookup (Think SUMPRODUCT would work)

    Thanks NDM. I will use this in the interim so I can get on with the analysis, but with lots of Keys, and Categories I was hoping for a SUMPRODUCT solution like Fotis produced.

    Any other SUM PRODUCT gurus out there?

    Jay

  6. #6
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Double Variable Lookup (Think SUMPRODUCT would work)

    Apologize for the delay! As i said, too much work for me today.....

    One helper(& hidden column) in this solution.

    In P4 & copy down.

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


    Then in Q4 and copy down and across.

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

  7. #7
    Registered User
    Join Date
    09-09-2006
    MS-Off Ver
    Excel (Office 365 ProPlus)
    Posts
    47

    Re: Double Variable Lookup (Think SUMPRODUCT would work)

    Sorry to be a pain here Fotis, but its not giving the right answer when I look at the business splits. Long handed I calculate that Business 1 should total 138, whereas the solution you so kindly provided totals 98.

    Each line item can use a different key, so a category has more than 1 key, which is why I thought it had to be an array with SUMPRODUCT, and not just an INDEXMATCH to look up the correct allocation key.

    Jay

  8. #8
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Double Variable Lookup (Think SUMPRODUCT would work)

    Here is the beginnings of what could be an awful formula if there are more categories, keys and companies. Enter in P4 and fill across and down.

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

  9. #9
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Double Variable Lookup (Think SUMPRODUCT would work)

    Assuming the businesses will always be in the same order in H3:L3 as P3:T3 you can use this formula in P4 copied across and down

    =SUMPRODUCT(($B$4:$B$10=$O4)+0,SUMIF($G$4:$G$7,$D$4:$D$10,H$4:H$7),$C$4:$C$10)

    If the businesses might be in a different order you can use this version to explicitly look up the business and get the correct key percentages

    =SUMPRODUCT(($B$4:$B$10=$O4)+0,SUMIF($G$4:$G$7,$D$4:$D$10,INDEX($H$4:$L$7,0,MATCH(P$3,$H$3:$L$3,0))),$C$4:$C$10)
    Audere est facere

  10. #10
    Registered User
    Join Date
    09-09-2006
    MS-Off Ver
    Excel (Office 365 ProPlus)
    Posts
    47

    Re: Double Variable Lookup (Think SUMPRODUCT would work)

    Fabulous. Have made my day. Thanks DLL!

    Jay

+ 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] SUMPRODUCT to lookup based on multiple criteria - how does it work?
    By andrewc in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 11-22-2013, 11:57 AM
  2. [SOLVED] sumproduct function in VBA does not work with variable name
    By anand_erin in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 10-26-2012, 05:20 PM
  3. Replies: 1
    Last Post: 02-28-2012, 02:55 AM
  4. what are double -- in sumproduct for
    By freakadlibitur in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-20-2008, 05:16 PM
  5. Double lookup doesn't work (properly)
    By dominicb in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-14-2008, 10:58 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