Professional Documents
Culture Documents
The goal of this module is to create a dynamic "dashboard" or "Report". A partial image of what we will
be creating is shown below. It contains graphs and tables that display information relevant for a
presentation or decision maker.
The dashboard is also dynamic. If you click a company's radio button, the data in all of the charts and
tables on the dashboard update to display data for the company selected. It also contains drop down
lists that allow you to select the financials you wish to view (top chart only), macro buttons to display
charts as either lines or columns, and a button to print the dashboard as a report.
The optionally displayed "Developer" tab makes such actions as recording macros and accessing the VBA
editor easier and is necessary to access the forms tools. To display the Developer tab:
1. Right click any existing menu tab and select "Customize the Ribbon".
2. If necessary, select "All Tabs" from the list.
3. Check "Developer" then click "OK".
Form Tools
Choose()
Match()
Index()
2.
We will now create the radio buttons shown to the right. We will be placing these inside an option group
so the radio buttons will work as a group. Note the following as you work:
3.
When options buttons are working as a group, clicking one of the option buttons outputs a number that
corresponds to that option button. Typically the first option button is 1, the second is 2, and so on. In
this section we will tell the buttons to store that number in cell P6.
1.
2.
3.
4.
5.
6.
7.
8.
4.
To pull the correct company name out of our database on the "DBFormat" tab, we need to use actual
company names, not numbers. We could use Vlookup() or a nested IF() to do this but because it is a
relatively small list of companies, we will use Choose(). Choose() is used to assign an item to a number
based on its position on a list.
Syntax: =Choose(Index Number, Item1, Item2, Item3, etc.)
Example: =CHOOSE(2,"ACME","Mom Corp.","Oceanic Airlines","Stark Industries","Tyrell
Corp.","Umbrella")
Returns Mom Corp. because Mom Corp. is in the second item (Item2) on the list.
1. In cell P7 type:
=CHOOSE(P6,"ACME","Mom Corp.","Oceanic Airlines","Stark Industries","Tyrell
Corp.","Umbrella")
2. Select different option buttons and both the number in P6 should the company name in P7
should change.
5.
The other interactive part of our dynamic chart is the drop down that allows users to select the
financials they wish to view. To populate the choices for the drop down list, the choices must exist as a
list in cells as the image shown to the far right.
We could simply type them but we already have them on our "DBFormat" sheet but there are
duplicates. This technique shows you how to extract unique entries from a list.
1.
2.
3.
4.
5.
6.
7.
8.
6.
We will now create the drop down choices for our financial data.
1.
2.
3.
4.
5.
7.
=Index(DBFormat!$A$2:$D$309,
MATCH(1,(DBFormat!$A$2:$A$309=Dashboard!$P$7)*
(DBFormat!$B$2:$B$309=Dashboard!$K21)*
(DBFormat!$C$2:$C$309=Dashboard!B$20),0),4)
Unless you use range names (which we should have), absolute addresses never go away. We
intend to copy our formula to the other years and down one row so we need to make sure we
lock in most of the cell addresses in the formula above.
2. Copy the formula left and then down to fill in the rest of the table.
3. Change the radio buttons and drop down financials to test the data table.
8.
Now we need to label our chart table. Create the three links in cell B19, A21 and A22.
1. Click cell B19 and type =P7
2. Click cell A21 and type =K21
3. Click cell A22 and type =K22
9.
5.
6.
7.
8.
9.
Change chart layout: insert Chart Title element and change position of Legend element
Click Chart Title element to select it
In the formula bar type =P7.
Press Enter key.
Testing: select different companies and financials to see the chart change.