SUMPRODUCT Function to Drive Financial Statements
If you need to report statistics or financial data in a standard template each month, consider using Excel as a simple database and the SUMPRODUCT function within formulas as the engine that drives the reporting. For example, many financial reports include the following standard data elements:
- Current month and year-to-date results.
- The variance of current month and year-to-date results against a plan.
- Current month and year-to-date results measured against the same month last year and year-to-date.
As soon as the data is compiled, many analysts enter the data into a spreadsheet. They then change the formulas in the report to reference the data that needs to appear for the most current month. Given the manual changes to formulas, the risk of error is increased.
Rather than recreating formula references each month, the spreadsheet can be set to work much more efficiently. By changing the month in one cell and the year in another, the SUMPRODUCT function when used within formulas can automatically update the entire report.
The following example is based on two sheets in a workbook:
- The first sheet, called "dBase", contains the data needed to feed the report.
- The second sheet, called "Rpt", contains the actual report. It also contains two cells that allow the user to update the report by changing the year and the month.
Beginning the example, the screenshot below is a very simple example of the data that might be needed for the typical financial statement. The worksheet in which the data resides is called "dBase":
The report below contains the elements as described in the bullets above. The worksheet in which the report resides is called "Rpt".
SUMPRODUCT formulas are included in the formulas within the report. Those formulas act as month and year-to-date lookups.
To build the SUMPRODUCT formulas, I've first created two named ranges. The first named range, called "Year", covers the range B4:B29 of the dBase sheet. The named range dialog box for the formula named "Year" looks like this:
The second named range, called "Month", covers the range C4:C29 of the dBase sheet. The named range dialog box for the formula named "Month" looks like this:
Now it's time to build the report. The SUMPRODUCT function within formulas looks up the report data based on the entries into cells E4 (the Year) and E5 (the Month). The formulas are as follows:
| Monthly Financial Results - Revenue | |
| Cell | Formula |
| D16 | =SUMPRODUCT((Year=Rpt!$D$2)*(Month=Rpt!$D$3)*(dBase!$E$4:$E$29)) |
| E16 | =SUMPRODUCT((Year=Rpt!$D$2)*(Month=Rpt!$D$3)*(dBase!$H$4:$H$29))-D13 |
| F16 | =SUMPRODUCT((Year=Rpt!$D$2-1)*(Month=Rpt!$D$3)*(dBase!$E$4:$E$29)) |
| Year-To-Date Financial Results - Revenue | |
| Cell | Formula |
| I16 | =SUMPRODUCT((Year=Rpt!$D$2)*(Month<=Rpt!$D$3)*(dBase!$E$4:$E$29)) |
| J16 | =SUMPRODUCT((Year=Rpt!$D$2)*(Month<=Rpt!$D$3)*(dBase!$H$4:$H$29))-I13 |
| K16 | =SUMPRODUCT((Year=Rpt!$D$2-1)*(Month<=Rpt!$D$3)*(dBase!$E$4:$E$29)) |
| Monthly Financial Results - Expense | |
| Cell | Formula |
| D18 | =SUMPRODUCT((Year=Rpt!$E$4)*(Month=Rpt!$E$5)*(dBase!$F$4:$F$29)) |
| E18 | =SUMPRODUCT((Year=Rpt!$E$4)*(Month=Rpt!$E$5)*(dBase!$I$4:$I$29))-D18 |
| F18 | =SUMPRODUCT((Year=Rpt!$E$4-1)*(Month=Rpt!$E$5)*(dBase!$F$4:$F$29)) |
| Year-To-Date Financial Results - Expense | |
| Cell | Formula |
| I18 | =SUMPRODUCT((Year=Rpt!$E$4)*(Month<=Rpt!$E$5)*(dBase!$F$4:$F$29)) |
| J18 | =SUMPRODUCT((Year=Rpt!$E$4)*(Month<=Rpt!$E$5)*(dBase!$I$4:$I$29))-I18 |
| K18 | =SUMPRODUCT((Year=Rpt!$E$4-1)*(Month<=Rpt!$E$5)*(dBase!$F$4:$F$29)) |
| Monthly Results - FTEs | |
| Cell | Formula |
| D22 | =SUMPRODUCT((Year=Rpt!$E$4)*(Month=Rpt!$E$5)*(dBase!$G$4:$G$29)) |
| E22 | =SUMPRODUCT((Year=Rpt!$E$4)*(Month=Rpt!$E$5)*(dBase!$J$4:$J$29))-D22 |
| F22 | =SUMPRODUCT((Year=Rpt!$E$4-1)*(Month=Rpt!$E$5)*(dBase!$G$4:$G$29)) |
| Year-To-Date Results - FTEs | |
| Cell | Formula |
| I22 | =SUMPRODUCT((Year=Rpt!$E$4)*(Month<=Rpt!$E$5)*(dBase!$G$4:$G$29))/E5 |
| J22 | =SUMPRODUCT((Year=Rpt!$E$4)*(Month<=Rpt!$E$5)*(dBase!$J$4:$J$29))/E5-I22 |
| K22 | =SUMPRODUCT((Year=Rpt!$E$4-1)*(Month<=Rpt!$E$5)*(dBase!$G$4:$G$29))/E5 |
To conclude, this setup allows allows the user to enter data into the dBase sheet. The user can then automatically update the report for any month and year via inputs to the month (cell E4) and year (cell E5) inputs in the Rpt sheet.