Forum Discussion

gurubengaluru's avatar
gurubengaluru
Copper Contributor
Jan 24, 2024

Summarize Data: 3 parameters [Department, Expense, Months], Values as sum of 3 months.

Hi,

 

I have a table where monthly budgets are available based on expense heads and departments. I need to summarize this data for Year to Date analysis (eg. Total of Jan to Mar numbers). Columns should be expense heads (like COGS, Salary, Consultants), Rows should be departments (like Sales, Engg., Admin), and values shall be sum of Jan to March figures. Is there a way to do this easily? Currently I am using INDEX MATCH. But it is cumbersome as I have to keep extending the formula each month. 

[ Eg: =INDEX($B$6:$N$11,MATCH($A40,$A$6:$A$11,0),MATCH($G$40,$B$4:$M$4,0))+INDEX($B$6:$N$11,MATCH($A40,$A$6:$A$11,0),MATCH($G$41,$B$4:$M$4,0))+INDEX($B$6:$N$11,MATCH($A40,$A$6:$A$11,0),MATCH($G$42,$B$4:$M$4,0)) ]

 

Appreciate your help. Here is the data sample.

 

Input Data             
              
Budget - Expenses by DepartmentBudget
($ Thousands)Jan-24Feb-24Mar-24Apr-24May-24Jun-24Jul-24Aug-24Sep-24Oct-24Nov-24Dec-24FY 2024
Department: Engineering             
Cost of Goods Sold2002002002002002002002002002002002002400
Salary Cost4004004004004004004004004004004004004800
Consultants505050505050505050505050600
Travel101010101010101010101010120
Marketing55555555555560
Other Expenses77777777777784
Total6726726726726726726726726726726726728064
              
Department: Sales             
Cost of Goods Sold             
Salary Cost3503503503503503503503503503503503504200
Consultants55555555555560
Travel505050505050505050505050600
Marketing1001001001001001001001001001001001001200
Other Expenses999999999999108
Total5145145145145145145145145145145145146168
              
Department: Admin             
Cost of Goods Sold             
Salary Cost1001001001001001001001001001001001001200
Consultants252525252525252525252525300
Travel55555555555560
Marketing             
Other Expenses151515151515151515151515180
Total1451451451451451451451451451451451451740
              
Total Budget13311331133113311331133113311331133113311331133115972
              
              
              
Requirement             
Budget Year to Date (YTD) - Eg: Jan to Mar 2024             
January to March             
ParticularsEngineeringSalesAdminTotal         
Cost of Goods Sold600  600 Jan-24       
Salary Cost120010503002550 Feb-24       
Consultants1501575240 Mar-24       
Travel3015015195         
Marketing15300 315         
Other Expenses21274593         
Total201615424353993         

5 Replies

  • Lorenzo's avatar
    Lorenzo
    Silver Contributor

    Hi gurubengaluru 

     

    In principal a PivotTable should do what you expect, it depends on how your data are stored on a sheet...

    1. Could you post a reprensentative sample workbook?
      (if not allowed to attach here yet, share with https://support.microsoft.com/en-us/office/share-onedrive-files-and-folders-9fcc2f7d-de0c-4cec-93b0-a82024800c07, Google Drive...)
    2. What version of Excel do you run?
    3. On which OS (Windows, MacOS....)?
    • gurubengaluru's avatar
      gurubengaluru
      Copper Contributor
      Hi Lz,

      Thank you for the response.
      1. Here is the link to excel file: https://1drv.ms/x/s!AiZbUq129VyDhKN_O77QSSOqqIJnGA?e=Z6Qlwd
      2. I am using Office 365 subscription. (Microsoft® Excel® for Microsoft 365 MSO (Version 2401 Build 16.0.17231.20084) 64-bit )
      3. OS: Windows 11

      Thanks again.
      • Lorenzo's avatar
        Lorenzo
        Silver Contributor

        Hi gurubengaluru 

         

        In attached workbook the Range of cells I colored in yellow (only for you to understand/replicate):

         

        is named BudgetData (see in Name Manager) - Eventually it can be https://support.microsoft.com/en-us/office/format-an-excel-table-6789619f-c889-495c-99c2-2f971c0e2370#:~:text=1%20Select%20any%20cell%20in%20the%20table%20from,displayed%20in%20the%20default%20table%20format.%20See%20More (would be ideal) but I didn't want to change your current setup

         

        This named range is transformed with Power Query so the Data Source for the PivotTable looks like:

         

         

        Make sense? Any question let me know (I won't be much avail. in the next few days)

Resources