+ Reply to Thread
Results 1 to 6 of 6

Excel sum column with values derived from a lookup table

  1. #1
    Registered User
    Join Date
    03-10-2013
    Location
    Wellington, NZ
    MS-Off Ver
    Excel 2013
    Posts
    3

    Excel sum column with values derived from a lookup table

    Hi,

    I'm looking for a function that will sum a set of values derived from entries in a column, but stored in a lookup table.

    For example:

    Column 1 Column 2 Column 3
    Row 1 B A D
    Row 2 B B A
    Row 3 B C B

    Where say in this case A=10, B=40, C=100, D=250. So you would expect the formula to return Column 1 = 120, Column 2 = 150, Column 3 = 300

    However, these values may change, so I'm looking for a dynamic formula that includes a lookup to a table where this mapping is stored rather than a series of nested IF statements or SUMIFS.

    Understand I could also write a simple macro to do this, but would prefer not to if there is another solution.

    I have tried various things including an array formula using SUM/INDEX/MATCH, but have had no luck so reaching out!

    Any help would be appreciated thanks.
    Last edited by jeremygraham; 03-26-2013 at 11:11 PM.

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,939

    Re: Excel sum column with values derived from a lookup table

    Hi and welcome to the forum

    My 1st reaction is to suggest some helper columns (which you can hide), where you lookup the value in the table, then sum the helper.

    Some-one will probably offer a better option, but give this 1 some thought too
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  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: Excel sum column with values derived from a lookup table

    How do you arrive at those results?

    Column A should = 330
    Column B should = 60
    Column C should = 300

    The formula that will give you those results...

    Create the lookup table:

    F1: A...G1: 10
    F2: B...G2: 40
    F3: C...G3: 100
    F4: D...G4: 250

    Then, this formula entered in A5 and copied across:

    =SUMPRODUCT(SUMIF($F1:$F4,A1:A3,$G1:$G4))
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  4. #4
    Registered User
    Join Date
    03-10-2013
    Location
    Wellington, NZ
    MS-Off Ver
    Excel 2013
    Posts
    3

    Re: Excel sum column with values derived from a lookup table

    Sorry Tony, typo translating my dummy worksheet into HTML table... have fixed.

  5. #5
    Registered User
    Join Date
    03-10-2013
    Location
    Wellington, NZ
    MS-Off Ver
    Excel 2013
    Posts
    3

    Re: Excel sum column with values derived from a lookup table

    Superb, and so simple!

    Thanks very much Tony

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

    Re: Excel sum column with values derived from a lookup table

    You're welcome. Thanks for the feedback!

+ 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