0% found this document useful (0 votes)
48 views14 pages

Lecture 22 - Dashboards

The document provides detailed instructions for creating a more complex dashboard using Excel, incorporating formulas, macros, and visual elements. It guides the user through setting up data for key performance indicators, including sales and unresolved information, and includes steps for formatting and adding interactive elements like combo boxes. Additionally, it covers how to visually represent data through tables and charts, ensuring the dashboard is dynamic and user-friendly for a CEO's analysis.

Uploaded by

derpydiane101
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
48 views14 pages

Lecture 22 - Dashboards

The document provides detailed instructions for creating a more complex dashboard using Excel, incorporating formulas, macros, and visual elements. It guides the user through setting up data for key performance indicators, including sales and unresolved information, and includes steps for formatting and adding interactive elements like combo boxes. Additionally, it covers how to visually represent data through tables and charts, ensuring the dashboard is dynamic and user-friendly for a CEO's analysis.

Uploaded by

derpydiane101
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 14

Dashboards (continued)

Introduction
In our last lecture, we created a basic Dashboard. Now we are going to use formulas,
macros and the camera function, in addition to the charts and pivot tools we have already
worked with, to make a more complicated dashboard.

Getting Started
Before you can design a more complicated Dashboard, there are tricks you can use to help you.
You can draw out how you want the final product to look and use it like a blueprint to model
what you want create into the finished format. The other thing you have to do is set up your
data to use it how you want in the final Dashboard.

Setting Up Data
For this Dashboard, you will be looking to visually setup Sales and Unresolved information for a
company CEO. These are important KPI (Key Performance Indicators) for a company since Net
Sales gives them positioning within the industry, while Unresolved information gives them a
view as to where they could be collections-wise if they were able to resolve these to their
bottom line. The company is set up in eight separate regions, and you have data from all of
2015 and through period 6 of 2016.

1.Open the dashboard2.xlsx file, found in Canvas. This file has four sheets of data, and two
blank sheets (Dashboard and Dashboard Data).
2.On the Dashboard Data sheet, in cell A1, type Current Period.
3.In cell B1, type 6 (for period 6).
4.Right click on cell B1 and go to Format Cells.
5.In the Format Cells box, on the Number tab, choose Custom and in the Type box put
"Period: "#
6.Click [OK].

Your cell B1 should now visually say Period: 6, though if you click on the cell and look at the
formula bar, the value in the cell is still only 6. Next we’re going to set up an option for the CEO
to look at either all areas, or individual areas.

7.On the 2016 Info tab, highlight cells L2:T2 and copy them.
8.Go back to the Dashboard Data tab, click in cell A3, right click and choose Paste Special.
9.In the Paste Special box, click on Transpose and click OK.
10. This pastes your horizontal data in vertical form. Clear the fill colors and bold formats
from this. Your Dashboard Data should now look something like this:

The list of areas will be used for the CEO to choose what info they want to look at.
11. Click on the Dashboard sheet, then go to the Developer tab and from the Controls area,
use the Insert pulldown to select a Combo Box (top row of Form Controls, second from the
left).
12. Click by cell B5 to insert the combo box, then resize the combo box to fit in cells B5:D5.
13. In cell B2, type an Index formula: =INDEX('Dashboard Data'!A3:A11,C2,1) – the cell
will have a #VALUE! error – this will go away later, not to worry!
14. Right click on the Combo Box and choose Format Control.
15. Set the Input Range to the Dashboard Data tab cells A3:A11, and the Cell Link to $ C$2.
16. Move the Combo Box so that it spans B2:D2 (covering the formula you entered). Check
the pull down and make sure that you have each area’s totals and All Areas as selections.

Now we’re going to set up some data visually for the CEO to look at. We’ll look at the
Unresolved as a percentage of the total as well as a percentage of the net sales.

17. On the Dashboard Data tab, we’re going to make a table of percentages. Click in cell B3
and type =+Dashboard!B2 (this assures you’re using the data the CEO chooses).
18. In C3, type ‘Unresolved as a % to Total’.
19. In D3, type ‘Unresolved as a % to Net Sales’.
20. Word wrap cells C3 and D3 and fit them so it’s two lines and the height fits.
21. Copy cells C3 and D3 and paste into E3 and F3, respectively. Fit these cells also.
22. Merge and center cells C2:D2 and then also cells E2:F2.
23. In C2, type Area. In E2, type All Areas.
24. In cell B4 type 2015. In B5 type 2016 YTD and in B6 type Period. Right orient these
cells.
At this point, your Dashboard Data tab should look like this:

25. We’ll use a VLookup with Match formula to get our calculations. Click in cell C4, and
type the following formula: =VLOOKUP(2015,'2015 Info'!K:T,MATCH(B3,'2015 Info'!K2:T2,0)).
26. Format the cell to Percentage and two decimal places.
27. In cell C5, type the formula =VLOOKUP(2016,'2016 Info'!K:T,MATCH(B3,'2016
Info'!K2:T2,0))
28. In cell C6, type the formula =VLOOKUP(B1,'2016 Info'!K:T,MATCH(B3,'2016
Info'!K2:T2,0))
29. In cells D4:D6, use the exact same formulas, but change the 2015 and 2016 Info sheet
columns from K and T to U and AD.
30. Now use these formulas in cells E4 to E6:
E4) =VLOOKUP(2015,'2015 Info'!K:T,MATCH("All Areas",'2015 Info'!K2:T2,0))
E5) =VLOOKUP(2016,'2016 Info'!K:T,MATCH("All Areas",'2016 Info'!K2:T2,0))
E6) =VLOOKUP(B1,'2016 Info'!K:T,MATCH("All Areas",'2016 Info'!K2:T2,0))
31. In cells F4:F6, use the exact same formulas as in E4:E7, but using U and AD in place of
K and T.
32. If you go to the Dashboard tab and use the pull down to select Central Total, your
Dashboard Data sheet should now look like this:

Now let’s make this data more visually attractive for the CEO:

33. On the Dashboard Data tab, merge cells H1:K1 and color them green. Using an Arial 10
white font, type Unresolved as % to Total in cell H1.
34. Color cells H2:K7 a lighter yellow. Next highlight I4:J6 and color them white, and add
inner and outer borders.
35. In cell I3, type =+Dashboard!$B$2, and in J3 type ‘All Areas’.
36. In H4 type ‘2015’, in H5, type ‘2016 YTD’ and in H6 type ‘Period’.
37. Set J4=E4, J5=E5 and J6=E6.
38. In I4, put =IF($I$3=$J$3, " ",C4) then in I5 put =IF($I$3=$J$3, " ",C5) and then in
I6 put =IF($I$3=$J$3, " ",C6).
Now you should have this:

Now it’s your turn:


39. Using cells H9:K15, create a table exactly like the one we created in cells H1:K7, only
this time for Unresolved as % to Net Sales – and use light green instead of yellow.
When you finish, your sheet should look like this:
Using the Camera
Now let’s add those pretty tables we made to the Dashboard:

40. If you don’t already have it, use the Customize the Quick Access Toolbar option to add
the Camera, which is not found on the ribbon.
41. Highlight the Unresolved as % to Total table you created and then click the camera in
your quick access toolbar
42. Now go to the Dashboard tab and click in the upper left corner area of cell B5.
43. Go back to the Dashboard Data tab, highlight the other table (Unresolved as % to Net
Sales) and click the camera.
44. Go back to the Dashboard tab, and this time click next to the table you already added
so that the tables are next to each other. Size them so that they match.

Why use the camera instead of just copying and pasting? If you copy and paste as a picture, it
is a snapshot in time and will not change when you change the area selection using the pull
down. Using the camera prevents anyone from accessing the direct formula, but shows them
what you want them to see and changes dynamically.

Adding Another Element


Next let’s prepare some data for another dashboard element.
45. In cell A18 of the Dashboard Data worksheet, type ‘Overall Transactions’, and in cell
A23 type ‘Area Transactions’.
46. In cells A19 AND A24, put the formula =+Dashboard!B2
47. In cells B20 and B25, type ‘2015’
48. In cells B21 and B26, type ‘2016’
49. From C19:N19, enter the headers for the period as P1 (in cell C19), P2 (in cell D19),
etc., ending with P12 in cell N19.
50. Copy cells C19:N19 and paste them in cells C24:N24.

Setting up the Element Data


We’re going to add the transaction data in a graphical format, but first we need to set it up so it
is easier to use. The transaction data is found on the 2015 Transactions and 2016 Transactions
worksheets, but we want to store it with formulas to pull specific information based on what
selection was made in the pull down on the Dashboard tab.

51. Let’s start with Overall Transactions data – this one is fairly straightforward. In cell C20,
you want to enter a formula to give you the value for overall transactions for P1, 2015. So type
the formula ='2015 Transactions'!B2 – this returns the data you need.
52. Since the 2015 and 2016 Transactions tables are set up the same, this means that the
formula you enter in cell C21 for the transactions from P1, 2016 would be ='2016
Transactions'!B2
53. In cell D20 enter ='2015 Transactions'!B3 and in cell D21 enter ='2016 Transactions'!B3
54. Continue to fill in the formulas for cells E20 through N20 for the 2015 Transactions, and
then cells E21 through H21 for the 2016 transactions (since we only have data for 2016 through
P6).
Next we’re going to set up the data for the Area Transactions. This is a bit more complicated,
because the Area that you want the information for is dependent on what selection was made
in the pull down of the dashboard worksheet. This is why we put that formula in cell A24. 
55. In cell C25, we are going to use a fairly long IF function to get the data we need. Type
the following formula: =IF($A$24="All Areas",'2015 Transactions'!B2,IF($A$24="Atlantic
Total",'2015 Transactions'!C2,IF($A$24="Central Total",'2015
Transactions'!D2,IF($A$24="Midwest Total",'2015 Transactions'!E2,IF($A$24="Northeast
Total",'2015 Transactions'!F2, IF($A$24="South Total",'2015
Transactions'!G2,IF($A$24="Southeast Total",'2015 Transactions'!H2,IF($A$24="Southwest
Total",'2015 Transactions'!I2,IF($A$24="West Total",'2015 Transactions'!J2,0)))))))))

The formula we use for Area Transactions returns different data dependent on what was
selected in the Dashboard, the value of which is returned in cell A24.
However, that is a long formula to type, right? How can we make that easier? Let’s try
something a little different to find the 2016 Transactions. You may remember from your Math
classes that if you multiply something by 1, you get something, while if you multiply something
by 0, you get 0.
Excel translates TRUE values to 1, and FALSE values to 0 – so you can use that math in your
formula!
56. In cell C26, use this: = SUM('2016 Transactions'!B2*($A$24= "All Areas"))+('2016
Transactions'!C2*($A$24 = "Atlantic Total"))+('2016 Transactions'!D2*($A$24 = "Central
Total"))+('2016 Transactions'!E2*($A$24 = "Midwest Total"))+('2016 Transactions'!F2*($A$24
= "Northeast Total"))+('2016 Transactions'!G2*($A$24 = "South Total"))+('2016
Transactions'!H2*($A$24 = "Southeast Total"))+('2016 Transactions'!I2*($A$24 = "Southwest
Total"))+('2016 Transactions'!J2*($A$24 = "West Total"))

That is a bit better – but notice how cells A3 through A11 have text that matches the selection
value that the user chooses? We can use that to make an even simpler formula.
57. For P2, 2015 data, put the following formula in cell D25: = SUM('2015
Transactions'!B3*($A$24= A3))+('2015 Transactions'!C3*($A$24 = A4))+('2015
Transactions'!D3*($A$24 = A5))+('2015 Transactions'!E3*($A$24 = A6))+('2015
Transactions'!F3*($A$24 = A7))+('2015 Transactions'!G3*($A$24 = A8))+('2015
Transactions'!H3*($A$24 = A9))+('2015 Transactions'!I3*($A$24 = A10))+('2015
Transactions'!J3*($A$24 = A11))
58. And for the P2, 2016 data, put the following formula in cell D26: = SUM('2016
Transactions'!B3*($A$24= A3))+('2016 Transactions'!C3*($A$24 = A4))+('2016
Transactions'!D3*($A$24 = A5))+('2016 Transactions'!E3*($A$24 = A6))+('2016
Transactions'!F3*($A$24 = A7))+('2016 Transactions'!G3*($A$24 = A8))+('2016
Transactions'!H3*($A$24 = A9))+('2016 Transactions'!I3*($A$24 = A10))+('2016
Transactions'!J3*($A$24 = A11))
59. You will continue this format to fill in the remaining period data in cells E25 through
N25 for 2015, changing the 2015 Transactions cell reference to match the data you are looking
for. Then update cells E26 through H26 for 2016, changing the 2016 Transactions cell reference
to match the data you are looking for. You can use whichever of the three formula options you
want.
When finished, if you choose All Areas from your Dashboard pulldown, your Dashboard Data
sheet should look like this:

Next we are going to use this data to add graphing to our Dashboard.
60. On the Dashboard Data tab, highlight cells B24:N26.
61. On the Insert tab, insert a Line with Markers chart (fourth option in the Line Chart
pulldown).
62. Cut the chart and paste it into the Dashboard tab, under the previous tables (leaving a
bit of space) about row 18.
63. Resize the chart to match the width of the tables.
64. Click on the Plus sign to the right of the chart to add a Chart Element – check the box
for Data Table, and uncheck the box for Legend.
We took off the Legend because having the data table indicates which line is for which year,
so having both is redundant.
Formatting the Chart
65. Change the fill color of your chart – right click on the chart and select Format Chart
Area, then in the Fill section change the color to the third orange color (Accent 2, Lighter 60%).
66. Make the data stand out – right click in the Plot area of the chart and select Format Plot
Area, then change its Fill Color to white.
67. Now let’s add a specialized header – go to the Dashboard Data tab, and first make a
table to use, so we can translate totals to areas. In cells A34 to B42, put the following:
All Areas All Areas
Atlantic Total the Atlantic Area
Central Total the Central Area
Midwest Total the Midwest Area
Northeast Total the Northeast Area
South Total the South Area
Southeast Total the Southeast Area
Southwest Total the Southwest Area
West Total the West Area

68.Now let’s use that table to make the header. In cell A30 type the following formula:
="Unresolved as Compared with Previous Year for "&(VLOOKUP(A24,A34:B42,2,FALSE))&" for
Period "&$B$1

This will give us a specialized header using a vlookup on the table we added in the middle of
some text and uses the period chosen within its corresponding cell. We can add that to our
chart, and it will change based on what is selected in the Dashboard pulldown!
Now let’s format this in the Dashboard Data sheet, before we use it on our Dashboard main
page.

69. Widen column A to about 40.00, and word wrap the text in cell A30.
70. Fill the cell a gray color – in the Fill box, use the third column, third one down.
71. Use the camera to take a picture of the cell.
72. Go to the Dashboard tab and paste the picture onto your chart in the upper left corner
– widen it to cover the “Chart Title” box.
73. With the picture selected, hold down shift and click the chart to select both items. Right
click, then go to Group and select Group from the right side menu. This insures that if you
reposition the chart, the specialized header you just made goes with it. In addition, using the
camera insures that if the period and area change, so does your header!
74. Move the chart up so there is less space between the tables and the chart. The
Dashboard should look something like this:

75. Now create a chart almost identical to the one we just made, but for the Overall
Transactions information on the Dashboard Data worksheet. Use the following differences:
a. Make your lines and markers green instead of blue, and red instead of orange.
b. The text box picture should say “Overall Transactions as Compared with Previous
Year for All Transactions” – it needs no formulas, but you should use cell A31 on
Dashboard Data and take a picture of it (don’t forget to group it with the chart!)
Now your Dashboard should look like this:
Hmmmm – now what if the CEO is looking at this Dashboard, and he wants to see a different
period besides the one we’ve set up? Let’s fix that.

76. On the Dashboard Data sheet, in cell M4 type Period 1, then in cell M5 type Period 2
and so on until you have Period 12 in cell M15.
77. Click on the Dashboard sheet and in cell G2, type an Index formula:
=INDEX('Dashboard Data'!M4:M15,H2,1)
78. Go to the Developer tab and from the Controls area, use the Insert pulldown to select a
Combo Box (top row of Form Controls, second from the left).
79. Resize the combo box so it aligns to the green table box similar to how the other combo
box aligns to the yellow table box.
80. Right click on the Combo Box and choose Format Control.
81. Set the Input Range to the Dashboard Data tab cells M4:M15, and the Cell Link to
$H$2.
82. Go to the Dashboard Data tab, and change the value of 6 currently in cell B1 to the
formula =+Dashboard!H2
This works but for one small problem – if the CEO chooses a period we don’t have data for yet,
the charts will only show until P6 and the tables will show an error of #DIV/0! Because the
divisor is blank, which Excel reads as zero. So let’s fix those to show the CEO that no data is yet
recorded for the period selected. Or, better yet, lets only allow him to select periods that we DO
have data for.
83. Change the formula in M4 to read: =IF(C21= 0,"P1 Data not available", "Period 1"),
then change M5 to read: =IF(D21= 0,"P2 Data not available", "Period 2").
84. Do the same for cells M6 through M15, increasing the letter of row 21 by one and the
period by one for each (E21 with P3 and Period 3, F21 with P4 and Period 4, etc.)
Now the pull down will show “P# data not available” for all periods unavailable – but if one of
these is chosen, the tables will still show the #DIV/0 error. Let’s fix that also.

85. On the Dashboard Data tab, change the formula in cell C6 from this:
=VLOOKUP(B1,'2016 Info'!K:T,MATCH(B3,'2016 Info'!K2:T2,0)) to this:
=IF(ISERROR(VLOOKUP(B1,'2016 Info'!K:T,MATCH(B3,'2016 Info'!K2:T2,0))),0,
VLOOKUP(B1,'2016 Info'!K:T,MATCH(B3,'2016 Info'!K2:T2,0)))

This says that if the value of the Vlookup/Match formula would return an error, use a zero
instead. Otherwise, use the formula. Repeat this for the formulas in cells D6, E6 and F6.
Now, your Dashboard should have zero values in the tables for the Period if an invalid period is
chosen, and the pulldown should read “P# data not available”.

86. Now let’s format the Dashboard itself. Insert a row into above row 1.
87. Highlight cells A1:K42 and fill them white.
88. Insert two text boxes – one above each pulldown. The area one should say “Please
choose an Area:” while the Period one says “Please choose a Period:”, and use a bold size 14
Callibri font.
89. Highlight column L and Ctrl-Shift-Right Arrow to select all columns outside of the
Dashboard information area. Right click and Hide those.
90. Highlight row 43 and Ctrl-Shift-Down Arrow to select all rows outside of the Dashboard
information area. Right click and Hide those as well.
91. Click on the View menu and uncheck the box for Headings in the Show area.

Now your Dashboard should look like this:

Now let’s add some macros. Record a macro, then stop the recording without doing anything
(you can call it Macro_One). Open Visual Basic from the Developer tab.

92. Alter your macro to read as follows:


Sub InfoOne()
'
' 2016 Info Macro
'
Sheets("2016 Info").Select
Range("A2").Select
'
End Sub
93. Copy the Visual Basic code, press enter to add a line after End Sub and paste – Visual
Basic will add a line between what is now two modules.
94. Alter the second to be Sub InfoTwo and change 2016 to 2015.
95. Enter to add a line after End Sub of the new code, and paste again. Now there are
three modules. Alter the third to be Sub InfoOneTrans, and change Info to Transactions.
96. Enter to add a line after End Sub of the new code, and paste again. Now there are four
modules. Alter the fourth to be Sub InfoTwoTrans, change Info to Transactions and change
2016 to 2015.
Your Visual Basic code should look like this:

97. Add one more module:


Sub Dashboard()
'
' Return to Dashboard Macro
'
Sheets("Dashboard").Select
Range("B4").Select
'
End Sub
98. Right click on the Yellow table on the Dashboard sheet and select “Assign Macro”.
99. Select the InfoOne Macro and click [OK].
100. Right click on the Green table on the Dashboard sheet and select “Assign Macro”.
101. Select the InfoOne Macro and click [OK].
102. Follow the same steps to assign the InfoOneTrans macro to both graphs on the
Dashboard sheet.
103. Go to the 2016 Info worksheet, and, from the Developer tab, use the Insert pulldown
in the Controls area to Insert a Button (it is the first option in the pull down).
104. Click in cell A1 to add the button, and assign the InfoTwo Macro when asked.
105. Make row 1 larger, and rename the button to “Go to 2015 Data”. Resize the button so
it can be easily read.
106. Add another button – next to the one you just made, but call this one Return to
Dashboard and assign the Dashboard macro. Size it so it can be read also.
107. Right click on the Return to Dashboard button and choose Copy.
108. Paste the button in row A of the 2015 Info sheet, then in cell F19 of the 2015
Transactions sheet, and in cell F17 of the 2016 Transactions sheet.
109. Go back to the 2016 Info worksheet, copy the Go to 2015 Data button and paste it
into cell D17 of the 2016 Transactions sheet.
110. Right click on the button on the 2016 Transactions sheet and choose Assign macro.
111. Select the InfoTwoTrans macro.
112. Hide the Dashboard Data sheet.
113. Insert a text box on the Dashboard sheet – put it in the upper right hand corner, size
it to fit, put a line border around it (the default color is fine) and have it say “Click on a
graphic to go to the underlying data”.

You’ve now created a dynamic, interactive Dashboard that changes dependent on choices made
by the user.

Click on the File tab, then choose Save As.

Save the file to your computer as “Assignment 22.[Your Last Name].xlsm” (make sure to use
xlsm so you don’t lose your macros!!).
In Canvas, upload your assignment document as the response to Question 1 in the Lecture 22
assessment, then answer the rest of the assessment based on your file and/or comprehension
of the lecture.

You might also like