Excel Formula Help

Occasional Visitor

Hello! I need some help with formulas. I'm making an expense sheet and want to make a vertical column for "departments". Looking to create a formula that adds up the different departments in that single column with a line under the table for each department that displays the total. 

3 Replies


I'd create a pivot table based on the data. Add the department field (column) to the Rows area and the expense field to the Values area.


See How to Set Up Excel Pivot Table 


With Office 365 or Excel 2021 or Excel for the web you can try this:






Here's a solution using REDUCE:


Summarize(a, v)
=LET(filtered, SUM(FILTER(val, dept = v)), VSTACK(a, HSTACK(v, filtered)))

Sheet Level formula: