Dynamic formulas are the cornerstone of interactive reports like dashboards. They enable our report recipients to interact with the data, and if set up right they can make our reports quicker and easier to update each month/week etc.
With just one data validation list or Combo Box we can control all of the formulas feeding our report. Simply select an item from the list and your entire dashboard updates just like this.
Interactive Excel Tools
PivotTables are great at allowing you to easily filter the data using the built in filter controls, or if you have Excel 2010 or later you can use Slicers for a more polished and intuitive interface:
Now, while I love PivotTables I sometimes find they are too restrictive when it comes to charting the data.
For example, you can’t create a chart like this with a PivotTable:
BTW, I teach you how to create charts like the one above in my Excel Dashboard course.
That’s when you need to call on Formulas to get the summarising job done, and the great news is we can link formulas to Data Validation lists so they’re interactive just like PivotTable filters or Slicers. Let’s look at an example.
Enter your email address below to download the sample workbook.
Interactive SUMIFS Formula
Below is my PivotTable looky-likey built using the SUMIFS function and a Data Validation list to control the country selection.
Looks just like the PivotTable, only nicer 🙂
Setting Up Interactive SUMIFS Formulas
First let me introduce the data; below is a sample of it which is formatted in an Excel Table called ‘data’ (note: Since I’ve formatted my data in a Table I’ll be using Structured References in my formulas):
And the SUMIFS formula in cell D9 is:
Remember the syntax for SUMIFS is:
=SUMIFS(the range you want to sum, range containing criteria 1, criteria 1, range containing criteria 2, criteria 2, range containing criteria 3, criteria 3…..)
Therefore the formula in cell D9 in English reads:
SUM the values in the Order Amount column IF, the values in the Order date column are, greater than or equal to 1 Jan 2012 AND, the values in the Order date column are, less than or equal to 31 Jan 2012 AND, the values in the Country column are, equal to the country selected in cell D6.
So, when the country selected in the data validation list in cell D6 changes, the SUMIFS formula automatically updates.
That is; by linking the third criteria to a cell containing a data validation list we have introduced a dynamic element which enables us to change the formula without having to edit it.
And when you use this data in a chart the chart becomes dynamic too (see example below).
Mix and Match
This technique isn’t limited to the SUMIFS function. Any of the …IF functions are ideal for dynamism e.g. SUMIF, COUNTIF, COUNTIFS, AVERAGEIF etc. and of course SUMPRODUCT.
You can also make any of the criteria (like dates) dynamic by simply linking the ‘criteria’ arguments to a cell containing a data validation list.
Combo boxes are an alternative to Data Validation lists.
You’ll find them on the Developer tab of the Ribbon:
The upside of a Combo Box is the drop down indicator is always visible, as you can see below:
The downside is they require an extra step since they return the position of the selected value in the list as opposed to the value itself (as seen in cell D33 below – i.e. USA is 2nd in the list).
The solution is to use the INDEX function to lookup the cells containing the list and return the actual value, as can be seen in cell F33 above which contains this formula:
Where the INDEX funtion looks up the 'Regions' column in the table called 'Region', and returns the value in the row number based on the item selected in the Combo Box.
You can then reference the value in D33 in your SUMIFS formula, or insert the INDEX formula directly inside your SUMIFS like this:
=SUMIFS(data[Order Amount], data[Order Date],">="&DATE($C38,1,1), data[Order Date],"<="&DATE($C38,12,31), data[Country],INDEX(region[Regions],$D$33)))
If you'd like to learn more techniques to make your Excel reports zing take a look at my Excel Dashboard course.
michel van drunen
Nice article, but why not use the get pivotdata function to create dashboards? It’s really fast and more dynamic in combination with slicers. Kind regards Michel
Cheers Michel. I love GETPIVOTDATA too and I teach that function in my Dashboard course, but I just realised that I haven’t written a blog post on it so I’ll add it to my list. Thanks for reminding me 🙂
Excellent tutorial .
Thanks, Ateny 🙂
Very good, as always, Mynda; but two things.
1 I try to download your file … Mac OS Maverick and Safari browser … and even when I try to right click and save in the downloads folder it saves as an html file. Alternatively it opens with an html page full of gobbledegook!
2 I don’t present dashboard seminars to the same extent as you do but something that has happened a few times this year is that delegates to my general Excel courses have been asking for dashboards that talk to them! That is, they want their dashboard to give them ratios, KPIs, charts … as interactive as possible, just like yours. THEN, they ask for output like this:
The average current ratio for Co XYZ over the last five years is 1.23:1 and for the latest year the ratio is 1.84:1
Co XYZ’s ROCE has fallen over the last five years although last year it rose by 3%
It’s all done with formulas and/or helper columns and CONCATENATION of course but this is what has been emerging for me.
Thanks for your kind words. Sorry you’re having trouble downloading the file. It’s the browser changing the extension on download. When you get to the ‘Save as’ window just type over the .html with .xlsx and then save it. You should be able to open it fine as it’s just a .xlsx file.
the ratios are interesting, as opposed to a pure percentage. You can do that easily with some formulas and concatenation. I teach that in the dashboard course 🙂
So thanks a lot, Mynda Treacy for your useful sharing
You’re welcome, Saad 🙂
Cool ideas. Thanks for sharing useful techniques.
Cheers, Jef 🙂