How to Show Subtotals in a Sorted Excel Database

by Charley Kyd on August 31, 2009

Just after I finished How to Report and Analyze Variable-Length Databases in Excel a visitor asked how to use formulas to show subtotals in a sorted list. From her description, she wants to do something like this:

Excel formulas calculate the subtotals in this list.

Excel formulas calculate the subtotals in this list.

In this figure, I set up the aaCustCode and aaAmount range names as I described in How to Report and Analyze Variable-Length Databases in Excel. Here’s the new formula for the cell shown:

C5:   =IF($A5=$A6,”",SUMPRODUCT((aaCustCode=$A5)*aaAmount))

Copy this formula to the range C6:C9. As more data is added, copy it down the column as needed.

{ 1 comment }

ljanis September 8, 2009 at 12:05 pm

Thanks! We’ll sure try this out.

Comments on this entry are closed.

Previous post: How to Report and Analyze Variable-Length Databases in Excel

Next post: Set Up Range Names to Connect Reports to Excel Databases, Part 3