+ Reply to Thread
Results 1 to 5 of 5

Sum values with lookup number specified by another matrix

  1. #1
    Registered User
    Join Date
    04-05-2017
    Location
    Washington, DC
    MS-Off Ver
    2010
    Posts
    2

    Sum values with lookup number specified by another matrix

    Hello, long-time reader, first-time poster,

    I'm not sure if I can succinctly describe this issue, but a workbook is attached in case I fail.

    I have a two-row matrix with variables LookupCode and ValuetoSum.

    I also have a matrix LookupCode by SumCategory, with X's to indicate the LookUpCodes relevant to each value of SumCategory.

    For each value of SumCategory, I want a sum of only the ValuetoSums associated with the LookupCodes indicated by this matrix.

    Notes: I have to do this many times over, with various ValuetoSum vectors, so adding other columns or rows to the worksheet would not be elegant. I strongly prefer a solution within Excel without using Visual Basic.

    It would be great if someone could help with this. Thank you very much!
    Attached Files Attached Files

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,416

    Re: Sum values with lookup number specified by another matrix

    You can put this formula in cell F3:

    =HLOOKUP(A3,$H$3:$P$4,2,0)

    and copy it down into F4:F11. Then you can put this formula in C15:

    =SUMIF(C$3:C$11,"X",$F$3:$F$11)

    and copy this across into D15:E15.

    Hope this helps.

    Pete

  3. #3
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    6,285

    Re: Sum values with lookup number specified by another matrix

    adding other columns or rows to the worksheet would not be elegant
    I disagree, strongly. Transpose your matrix, sort it according to the same sort as your lookupcodes in the first table, then use SUMIF, as in the attached. Better yet, don't use two tables, but just one, with the added column: both are shown in the attached.
    Attached Files Attached Files
    Bernie Deitrick
    Excel MVP 2000-2010

  4. #4
    Registered User
    Join Date
    04-05-2017
    Location
    Washington, DC
    MS-Off Ver
    2010
    Posts
    2

    Re: Sum values with lookup number specified by another matrix

    Hi,

    Thank you both for the ideas. The sections of the documents I'm working with are part of large and complex Excel files, so I was hoping to find some sort of clever INDEX MATCH solution or some such that wouldn't require me to create new rows or columns, or change the structure of existing ones. I think such a solution probably doesn't exist, or would result in a longer and more complex formula than it's worth it to implement. Your suggestions were helpful in working out a feasible solution.

    Michael

  5. #5
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    6,285

    Re: Sum values with lookup number specified by another matrix

    Sorry - posted to the wrong thread....

+ 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] Number Lookup in Matrix
    By N Harkawat in forum Excel Formulas & Functions
    Replies: 36
    Last Post: 09-06-2005, 12:05 PM
  2. [SOLVED] Number Lookup in Matrix
    By Rod in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 10:05 AM
  3. Number Lookup in Matrix
    By N Harkawat in forum Excel Formulas & Functions
    Replies: 24
    Last Post: 09-06-2005, 06:05 AM
  4. Number Lookup in Matrix
    By N Harkawat in forum Excel Formulas & Functions
    Replies: 36
    Last Post: 09-06-2005, 04:05 AM
  5. [SOLVED] Number Lookup in Matrix
    By Rod in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 03:05 AM
  6. [SOLVED] Number Lookup in Matrix
    By Rod in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 12:05 AM
  7. Number Lookup in Matrix
    By Rod in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-05-2005, 11:05 PM
  8. [SOLVED] Number Lookup in Matrix
    By Rod in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-05-2005, 10:05 PM

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