I dumped a SQL query into Excel and am looking for a way to automate this.
Here’s what I have.
site 12
site/subsite 22
another site 77
another site/subsite 16
My question is this: is there a way in Excel to add totals for the site and its associated subsite? I have about 4000 rows so am looking to save manual labor.
Use the
SUMIF()function.Here is an example that can get you started:
Put your data in columns A and B (sites in A, values in B).
Add a column header in cell D1 that matches one of the sites names exactly.
Add this formula in cell D2:
Modify the start and end rows to cover your entire data set. (In the example I set up, the data was in rows 6 through 17.)
You can list all of your sites and subsites and have formulas refer to the data range to calculate totals for each.