+ Reply to Thread
Results 1 to 9 of 9

Sum Values in a Table Matching Specific Row and Column Values

  1. #1
    Registered User
    Join Date
    07-09-2014
    Location
    Indianapolis, Indiana, USA
    MS-Off Ver
    Excel 2010
    Posts
    18

    Sum Values in a Table Matching Specific Row and Column Values

    Hey everyone! I've been coming here for quite a while and I can say that I've learned a lot just by reading other posts, so first let me say thanks to everyone that contributes! I'd love to contribute to the forums myself as I gain experience. Now, for my question/problem that I've come here today for:

    I have a workbook with multiple tabs that contain various tables full of data from different sources. I'm summarizing everything on the first tab in different columns depending on what I need to show. I'm breaking things down by month and each cell pulls in data from somewhere to summarize the activities. I have one tab containing the information I need and right now it's all included in my monthly breakout where this formula is used:

    =IF(IFERROR(SUM(INDEX('Report'!$G$2:$V$20000,,MATCH("001/2014",'Report'!$G$2:$V$2,0))),0),SUM(INDEX('Report'!$G$2:$V$20000,,MATCH("001/2014",'Report'!$G$2:$V$2,0))),SUM('Annual Plan'!$B$22+'Annual Plan'!$B$23))

    The data on the Report sheet has different information in columns A through F and then G through V give the dollar amounts by period. What I want to do is to isolate a few of the items where the value in column A is a specific value and then also exclude them from the cells where the above formula is being used.

    So, just as an example...on my summary view I have E1:E12 showing January through December and the total values for that month. Let's say that right now, E1 shows $100,000 but includes $10,000 that I want to isolate in F1:F12 (depending on the month). So now, E1 would show $90,000 and F1 would show $10,000. Hope that all makes sense! I attached an example with the Report tab showing random data in the layout that I get from my reports and the Summary tab showing a simplified view of what I'm doing on my summary tab.

    If you need more information on anything, let me know.

    I really appreciate any input and look forward to your suggestions/solutions!

    Dustin
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    07-10-2014
    Location
    East Sussex, England
    MS-Off Ver
    2007, 2010
    Posts
    51

    Re: Sum Values in a Table Matching Specific Row and Column Values

    Try this out, using named ranges for the months, and a condition formula to sort the data to be included (14600 or 14462 etc.) from the rest.

    Sum Values Using Row and Column Data - with new formula.xlsx

  3. #3
    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,929

    Re: Sum Values in a Table Matching Specific Row and Column Values

    Hi and welcome to the forum

    1 of the 1st things you need to learn, is keep your headings in the same format wherever possible. For instance in Summary, you have actual dates (which are numeric), but on Report, you have just text. Then you can use this for the 1st column...
    =SUMIF(Report!$A$4:$A$39,Summary!B$1,OFFSET(Report!$G$4,0,MATCH($A2,Report!$G$2:$R$2,0)-1,COUNTA(Report!A:A)-1,1))
    and this for the "others"
    =SUM(OFFSET(Report!$G$4,0,MATCH($A2,Report!$G$2:$R$2,0)-1,COUNTA(Report!A:A)-1,1))-B2
    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

  4. #4
    Registered User
    Join Date
    07-09-2014
    Location
    Indianapolis, Indiana, USA
    MS-Off Ver
    Excel 2010
    Posts
    18

    Re: Sum Values in a Table Matching Specific Row and Column Values

    Rob,

    Thanks so much for the help! This solution works and I will see if I can incorporate this formula into my file on Monday when I get back to work. Could you explain a bit about why you decided to use the INDIRECT and SUBSTITUTE formulas? I just want to make sure I understand when it is best to use these. Thanks again!

    Dustin

    Quote Originally Posted by Rob Kennedy View Post
    Try this out, using named ranges for the months, and a condition formula to sort the data to be included (14600 or 14462 etc.) from the rest.

    Attachment 331158

  5. #5
    Registered User
    Join Date
    07-09-2014
    Location
    Indianapolis, Indiana, USA
    MS-Off Ver
    Excel 2010
    Posts
    18

    Re: Sum Values in a Table Matching Specific Row and Column Values

    Ford,

    Thanks so much for the help! I typically do keep the headings the same but unfortunately this report that is generated is in one of our financial systems and it doesn't allow us to modify the outputs for the periods. So, I have to work with the "001/2014" format but I don't want to show periods in my summary since there are 16 financial periods in a year. So, with that being said...will the formulas below work with the outputs that I have to work with? Also, could you explain the use of OFFSET in this scenario and why it's beneficial? Thanks!

    Dustin

    Quote Originally Posted by FDibbins View Post
    Hi and welcome to the forum

    1 of the 1st things you need to learn, is keep your headings in the same format wherever possible. For instance in Summary, you have actual dates (which are numeric), but on Report, you have just text. Then you can use this for the 1st column...
    =SUMIF(Report!$A$4:$A$39,Summary!B$1,OFFSET(Report!$G$4,0,MATCH($A2,Report!$G$2:$R$2,0)-1,COUNTA(Report!A:A)-1,1))
    and this for the "others"
    =SUM(OFFSET(Report!$G$4,0,MATCH($A2,Report!$G$2:$R$2,0)-1,COUNTA(Report!A:A)-1,1))-B2
    Last edited by dubasteins; 07-12-2014 at 01:51 PM.

  6. #6
    Registered User
    Join Date
    07-09-2014
    Location
    Indianapolis, Indiana, USA
    MS-Off Ver
    Excel 2010
    Posts
    18

    Re: Sum Values in a Table Matching Specific Row and Column Values

    Rob,

    I see that you added a column to the report which is something that I won't be able to do. These are embedded into the document and connected to our financial system so the output must remain the same. Do you know of anything that would work without adding a column?

    Thanks,

    Dustin

  7. #7
    Registered User
    Join Date
    07-10-2014
    Location
    East Sussex, England
    MS-Off Ver
    2007, 2010
    Posts
    51

    Re: Sum Values in a Table Matching Specific Row and Column Values

    The formula

    INDIRECT(SUBSTITUTE(TEXT(A2,"mmm yy")," ","_"))

    turns the Cell value in A2 into the name of the named range, A2 is 1/1/2014, TEXT makes it a string in this format "Jan 14" then SUBSTITUTE takes the space out and replaces it with an underscore (= Jan_12) since named ranges cannot have spaces in them. INDIRECT makes XL look at the referenced 'indirectly' within the formula brackets, rather than the text as a 'text string'. In other words the formula will SUM "The range that is referred to as 'Jan_14' ".

    The new attached one does away with the column you say you can't have, does this help?

    Sum Values Using Row and Column Data... named ranges.xlsx

    If so, please give me a 'rep'. Thanks
    Robbo

  8. #8
    Registered User
    Join Date
    07-09-2014
    Location
    Indianapolis, Indiana, USA
    MS-Off Ver
    Excel 2010
    Posts
    18

    Re: Sum Values in a Table Matching Specific Row and Column Values

    Yes, that works and makes sense. I should become more familiar with named ranges! One additional question regarding this formula...how do I ensure that it works from year to year? For example, when the new fiscal year starts, I'd prefer that the formulas work automatically with the new reports (October 2014 through September 2015) without having to change the named ranges. This is important because I have multiple workbooks (one for each program that I am managing) and it would require a lot of work to ensure that everything is functioning properly. Everything else (in theory) will work in the new fiscal year without changing anything. Thoughts on that? Thanks!

  9. #9
    Registered User
    Join Date
    07-09-2014
    Location
    Indianapolis, Indiana, USA
    MS-Off Ver
    Excel 2010
    Posts
    18

    Re: Sum Values in a Table Matching Specific Row and Column Values

    Something I just noticed while working through some of the reports...while the values always start in column G, they aren't necessarily the first month of the fiscal year. For example, one report might span from G to V and include all 16 periods but another report might not have data for all periods so it'll run from G to N where the values in G are period 3, H are from period 5, I are from period 6, and so on. So, going back to the formula that I originally used (because it seems to do what I need it to)...how might I add an additional piece to that to have it look at both the periods AND the values in column A? I was trying to get an INDEX MATCH MATCH formula to work but couldn't exactly figure out how to make it operate. I'll keep experimenting but maybe someone has a suggestion on how to accomplish this? Thanks!

+ 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] Excel-13 Add values in array matching specific row labels, column labels within date range
    By fadeoutagain27 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 06-18-2014, 03:55 PM
  2. Replies: 3
    Last Post: 01-23-2014, 01:30 PM
  3. Replies: 1
    Last Post: 07-24-2013, 05:18 AM
  4. Table Lookup using 3 matching column values
    By mluetkem in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-09-2012, 01:38 PM
  5. Macro Loop to Extract Specific Values and Min/Max Values From Column/Rows Range
    By ExcelQuestFL in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 12-19-2010, 09:19 AM

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