+ Reply to Thread
Results 1 to 8 of 8

Summing indirect based on column and row headers

  1. #1
    Registered User
    Join Date
    03-25-2005
    Posts
    9

    Summing indirect based on column and row headers

    I have a spreadsheet that contains a tab for each of 10 projects (tab name = project name). Row 1 of each of those tabs contains dates, one column for each month (e.g. Dec-10, Jan-11, Feb-11, etc.). Rows 2 through n contain numbers.

    The spreadsheet also contains a Summary sheet. Dates matching those found in Row 1 of the project sheets are listed in Column A (starting in Row 2). Row 1 (starting at column B) contains the project names, which also match the tabs in the spreadsheet.

    What I'm trying to accomplish is to use INDIRECT based upon the project name in Row 1 and the date in Column 1 to sum the numbers found in the associated project tab in the associated column. I'm just not getting how to do it. Maybe indirect is not how it should be done.

    I've attached a spreadsheet containing what I've accomplished so far. I sure could use some advice on this. I'm lost.
    Attached Files Attached Files

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Summing indirect based on column and row headers

    Try something like:

    =SUM(INDEX(INDIRECT("'"&B$1&"'!A:R"),0,MATCH($A2,INDIRECT("'"&B$1&"'!$A$1:$R$1"),0)))

    where A:R covers all columns from each sheet that you need to look in... expand/contract as needed.
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Valued Forum Contributor
    Join Date
    07-17-2005
    Location
    Abergavenny, Wales, UK
    MS-Off Ver
    XL2003, XL2007, XL2010, XL2013, XL2016
    Posts
    608

    Re: Summing indirect based on column and row headers

    Hi

    One way
    Group all your Data sheets, other than the summary Sheet. Do this by clicking on the first of the sheet tabs, then hold down the Shift key whilst you click on the last of the tabs to be included.

    Insert a new row at the top of the first of the Grouped sheets, and in cell A1 enter the formula
    =SUM(A3:A300)
    Drag the formula across the sheet for as many columns as you are going to have data.
    Now, click on your Summary sheet (which will un-group all of the others)

    In cell B2 enter
    =INDEX(INDIRECT(B$1&"!A1:Z300"),1,ROW(A1))
    Copy across and down as far as required
    --
    Regards
    Roger Govier
    Microsoft Excel MVP

  4. #4
    Valued Forum Contributor
    Join Date
    07-17-2005
    Location
    Abergavenny, Wales, UK
    MS-Off Ver
    XL2003, XL2007, XL2010, XL2013, XL2016
    Posts
    608

    Re: Summing indirect based on column and row headers

    Hi

    Won't that add the date into the OP's result?
    The example sheet shows Serial 40603 formatted as mmm-yy as the column header on the data sheets

    Perhaps a modification to
    =SUM(INDEX(INDIRECT("'"&C$1&"'!A2:R300"),0,MATCH($A2,INDIRECT("'"&C$1&"'!$A$1:$R$1"),0)))

    would help

  5. #5
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Summing indirect based on column and row headers

    Or just cheat.....

    =SUM(INDEX(INDIRECT("'"&B$1&"'!A:R"),0,MATCH($A2,INDIRECT("'"&B$1&"'!$A$1:$R$1"),0)))-$A2

  6. #6
    Registered User
    Join Date
    03-25-2005
    Posts
    9

    Re: Summing indirect based on column and row headers

    Quote Originally Posted by Marcol View Post
    Or just cheat.....

    =SUM(INDEX(INDIRECT("'"&B$1&"'!A:R"),0,MATCH($A2,INDIRECT("'"&B$1&"'!$A$1:$R$1"),0)))-$A2
    That's it. Thanks you.

  7. #7
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Summing indirect based on column and row headers

    Hey!
    It's NBVCs' formula with a quick fix.

    Happy to help, or cheat when possible.....
    If you need any more information, please feel free to ask.

    However,If this takes care of your needs, please select Thread Tools from menu above and set this topic to SOLVED. It helps everybody! ....

    Also
    اس کی مدد کرتا ہے اگر
    شکریہ کہنے کے لئے سٹار کلک کریں
    If you are satisfied by any members response to your problem please consider using the small Star icon bottom left of their post to show your appreciation.

  8. #8
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Summing indirect based on column and row headers

    Yes Roger, thanks, I didn't take into account the date in the first row....

    and thanks Marcol, for the fix.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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