MSBA-175 · Lesson 11 of 12 · 20 min

Advanced charts and macros basics

▶ Video coming soon A video version of this lesson is on the way.

This lesson finishes the exam's content with two objectives from different domains. From manage advanced charts and tables: create and modify advanced charts, which names dual-axis charts and box and whisker, combo, funnel, histogram, map, sunburst and waterfall charts. From create advanced formulas and macros: create and modify simple macros, which means recording, naming and editing them, plus the related workbook task of copying macros between workbooks from the first domain. Dagny spent two Monday sessions here in early November, because the chart types are quick to make but easy to get subtly wrong.

Charts that need the right data

Every advanced chart type expects its data in a particular shape. Most problems on the exam come from selecting the wrong range, not from choosing the wrong command. All the types in this lesson are on Insert > Charts, either in their own buttons (Statistic, Hierarchy, Waterfall and Funnel, Map) or through Recommended Charts > All Charts.

ChartData shapeAnswers
ComboCategories plus two or more seriesHow do different measures move together?
HistogramOne column of raw numbersHow are values distributed?
Box and whiskerOne or more columns of raw numbersHow do distributions compare?
WaterfallLabels and positive or negative amountsHow does a starting value become an ending value?
FunnelStages and counts, largest firstWhere do numbers drop off?
SunburstHierarchy columns plus one value columnHow do parts nest within wholes?
MapGeographic names plus a value or categoryHow do values vary by place?

Combo and dual-axis charts

A combo chart uses two chart types in one chart, typically columns for one series and a line for another. A dual-axis chart plots one or more series against a secondary axis on the right, so that series measured in very different units can share one chart. Dagny's monthly chart showed booking revenue in tens of thousands of dollars and the number of events, which never exceeds about fifteen a month; on one axis, the event counts were a flat line along the bottom.

To build it, select the month labels and both series and choose Insert > Combo Chart > Clustered Column - Line on Secondary Axis. Or, to change an existing chart, choose Chart Design > Change Chart Type, pick Combo, and for each series set the Chart Type and tick Secondary Axis where needed. The same setting is in Format Data Series > Series Options > Plot Series On.

A combo chart of twelve months. Columns show revenue against a left axis in thousands of dollars, and a line shows the number of events against a right axis from 0 to 16. Both axes have titles.
A combo chart with a secondary axis lets revenue and event counts share one chart.

A secondary axis needs its own title, or readers cannot tell which scale belongs to which series. Add axis titles with Chart Elements (+) > Axis Titles, which offers primary and secondary titles separately. Format the secondary axis bounds in Format Axis > Axis Options if the automatic scale makes the line misleading. Use dual axes sparingly; two unrelated scales invite false comparisons, and a pair of small charts is often clearer.

Histogram and box and whisker

A histogram groups one column of numbers into bins and shows how many values fall into each. Select the Guests column of the bookings table and choose Insert > Statistic Chart > Histogram. Excel picks bins automatically; to control them, open Format Axis on the horizontal axis and set Bin width, Number of bins, Overflow bin or Underflow bin. Dagny set a bin width of 25 and an overflow bin of 250, so the few very large galas went into one final bar instead of stretching the chart. A Pareto chart, in the same menu, sorts the bins and adds a cumulative percentage line.

A box and whisker chart summarizes a distribution in five numbers: the box runs from the first to the third quartile, a line inside marks the median, an X marks the mean, and the whiskers reach to the furthest values that are not outliers, which appear as separate dots. Select one or more columns of values (or a category column and a value column) and choose Insert > Statistic Chart > Box and Whisker. Dagny compared wedding fees by package: one box each for Garden Gold, Harbor Classic and Lighthouse Premium showed that Lighthouse Premium had the widest spread of fees and two high outliers.

In Format Data Series, box and whisker options include Show inner points, Show outlier points, Show mean markers, Show mean line and the quartile calculation, Inclusive or Exclusive median. Exam tasks often name one of these options exactly.

Waterfall and funnel

A waterfall chart shows how a starting value is increased and decreased to reach an ending value. Dagny built one for the 2026 budget: revenue, then each cost as a negative amount, ending with net income. Select the labels and amounts and choose Insert > Waterfall, Funnel, Stock, Surface or Radar Chart > Waterfall. Excel colors increases and decreases differently, but it treats every bar as a change, including the final net income. To make a bar start from zero as a total, click that single data point, then in Format Data Point tick Set as total (or right-click it and choose the same).

A waterfall chart starting with a tall Revenue bar from zero, followed by floating downward bars for Direct costs, Salaries, Rent and Marketing, ending with a Net income bar that starts from zero because it is set as a total.
In a waterfall chart, the last bar must be set as a total so it starts from zero.

A funnel chart shows values decreasing through stages, such as Maple & Pine's sales process: enquiries, site visits, proposals sent, contracts signed. The data should be sorted from largest to smallest, because the chart draws bars in the order of the rows. Choose Insert > Waterfall, Funnel... > Funnel. Data labels are on by default; the gap width and colors are set in Format Data Series.

Sunburst and map

A sunburst chart shows a hierarchy as rings. The innermost ring is the top level and each outer ring breaks it down. The data needs one column for each level, left to right, and a value column at the end; blank cells at a lower level are fine where a branch stops early. Dagny used Category, EventType and Service with Fee as the value, so the chart showed weddings and corporate events, then each event type within them, then each service. Choose Insert > Hierarchy Chart > Sunburst. A treemap, in the same menu, shows the same data as nested rectangles.

A filled map chart colors regions by value or category. The first column must contain geographic names Excel can recognize, such as countries, provinces, states or postal codes, and a second column holds the values. Choose Insert > Maps > Filled Map. Excel sends the location names to the Bing service to find the shapes, so it needs an internet connection the first time. When names are ambiguous, adding a country column helps. In Format Data Series, Map projection, Map area (for example, only regions with data) and Map labels control the display. Dagny mapped the home provinces and states of wedding guests who traveled to Maple & Pine events, which showed Rosalind where to advertise destination packages.

Formatting advanced charts

The newer chart types share most formatting tools with ordinary charts: Chart Styles, Change Colors, Chart Elements for titles, labels and legends, and the Format pane for each element. Some options do not exist for them; for example, a histogram cannot have a trendline, and waterfall and funnel charts cannot be combined with other types. They also cannot be PivotCharts, as lesson 10 noted, so their data comes from ordinary ranges or tables. When the source is a table, the chart picks up new rows automatically.

Recording a macro

A macro is a recorded series of actions saved as Visual Basic for Applications (VBA) code. Dagny's first macro formatted the monthly bookings export: it set column widths, applied a number format to the Fee column, bolded the header row and froze panes. The Developer tab has the macro tools, but it is hidden by default; turn it on with File > Options > Customize Ribbon and tick Developer. View > Macros > Record Macro also works without it.

Record Macro settingRule or choice
Macro nameStarts with a letter; letters, numbers and underscores only; no spaces; not a cell address such as AB12
Shortcut keyCtrl plus a letter; type a capital to use Ctrl+Shift, which avoids overriding Excel shortcuts
Store macro inThis Workbook, New Workbook or Personal Macro Workbook
DescriptionOptional; stored as a comment in the code

Click OK and Excel records everything you do, including selections and mistakes, until you click Stop Recording (on the Developer tab, in View > Macros, or the square button on the status bar). By default the recorder uses absolute references, so it repeats actions on the same cells. Use Relative References on the Developer tab records positions relative to the active cell instead, which suits macros that should work wherever you start.

The Personal Macro Workbook (PERSONAL.XLSB) is a hidden workbook that opens whenever Excel starts, so macros stored there are available in every workbook on that computer. It suits personal tools, but other people do not have it; a macro that belongs with a specific file should be stored in that workbook, saved as .xlsm.

Running, naming and editing macros

Run a macro from Developer > Macros (Alt+F8): choose it and click Run. The same dialog has Edit, Delete and Options, where the shortcut key and description can be changed. A macro can also be attached to a button or shape (right-click the shape and choose Assign Macro) or added to the Quick Access Toolbar.

To rename or edit a macro, choose it and click Edit. The Visual Basic Editor opens with the code in a module. Each macro is a procedure that begins with a Sub line and ends with End Sub.

The recorded FormatBookings macro. Lines starting with an apostrophe are comments.
Sub FormatBookings()
'
' FormatBookings Macro
' Formats the monthly bookings export
'
    Rows("1:1").Select
    Selection.Font.Bold = True
    Columns("I:I").Select
    Selection.NumberFormat = "#,##0.00"
    Range("A2").Select
    ActiveWindow.FreezePanes = True
End Sub

To rename the macro, change the name after Sub and save; the new name must follow the same rules as in the Record Macro dialog. Simple edits are safe even without knowing VBA: changing a column letter, a number format or a value in quotation marks. Dagny changed "#,##0.00" to "#,##0" because fees are whole dollars, and changed the column letter after the bookings export gained a column. Close the editor with File > Close and Return to Microsoft Excel or Alt+Q; the workbook must still be saved as .xlsm to keep the change.

Worked problem

Fixing a macro that formats the wrong column

After the bookings export added a Region column before Fee, Dagny's macro formatted column I, which now holds Guests.

Show solution
  1. Press Alt+F8, choose FormatBookings and click Edit.
  2. Find the line Columns("I:I").Select and change both letters to J.
  3. Press Alt+Q to return to Excel, then run the macro on a test copy.
  4. Save the workbook as .xlsm.

Answer: The macro formats the Fee column in J again, and Guests keeps its plain number format.

Copying macros between workbooks

Macros live in modules inside a workbook's VBA project. To copy them to another workbook, open both workbooks, press Alt+F11 to open the Visual Basic Editor, and in the Project Explorer (Ctrl+R if it is hidden) drag the module, such as Module1, from one workbook's project onto the other's. Excel copies the whole module with every macro in it. Another method is to right-click the module, choose Export File to save a .bas file, then right-click the other project and choose Import File. For a single macro, copying the code from Sub to End Sub and pasting it into a module in the other workbook also works.

The destination must be saved as a macro-enabled file. Dagny copied FormatBookings from her test workbook into the invoice tracker, and also into her Personal Macro Workbook so she could use it on any export.

What the exam asks

Chart tasks on MO-211 usually name the chart type, the source range and one or two settings: a secondary axis for a named series, a bin width, a total in a waterfall, a style or a chart title. Select exactly the range given, including the header row if the task names it, and check the result against each requirement before moving on. Macro tasks typically ask you to record a macro with a given name, shortcut key and storage location, to modify a recorded macro, or to copy a module from one open workbook to another. The checker reads the name and shortcut from the workbook, so spelling and capitals matter. A recorded macro may contain extra selection steps, but its final effect must match what the task describes.

Common mistakes

  • MistakeLeaving a secondary axis without a title.

    InsteadAdd primary and secondary axis titles so each series has a scale.

  • MistakeLeaving the final waterfall bar as a change.

    InsteadSet the ending value as a total.

  • MistakeFeeding a funnel chart unsorted stages.

    InsteadSort the stages from largest to smallest.

  • MistakeNaming a macro Format Bookings or 2026Format.

    InsteadStart with a letter and use no spaces, for example FormatBookings.

  • MistakeSaving a workbook with a new macro as .xlsx.

    InsteadSave it as .xlsm, or the macro is removed.

Summary and key terms

  • Advanced charts depend on data shape: raw numbers for histograms and box plots, stages for funnels, hierarchies for sunbursts and place names for maps.
  • Combo charts mix types; a secondary axis lets different units share a chart.
  • Waterfall totals must be set with Set as total.
  • Record macros with a valid name, a shortcut and a storage location; edit them in the Visual Basic Editor.
  • Copy macros by dragging or exporting modules between VBA projects, and save as .xlsm.
Combo chart
A chart that uses two or more chart types.
Secondary axis
A second value axis for series in different units.
Box and whisker chart
A chart showing quartiles, median, mean and outliers.
Waterfall chart
A chart showing how increases and decreases lead from a start to an end value.
Macro
A recorded or written sequence of actions stored as VBA code.
Personal Macro Workbook
A hidden workbook whose macros are available in every workbook on one computer.
Module
A container for VBA procedures in a workbook's project.

Practice problems

Work each problem on paper first, then reveal the answer to check.

  1. Which chart shows how a starting value becomes an ending value?

    Show answer

    A waterfall chart.

  2. Where do you set a histogram's bin width?

    Show answer

    Format Axis on the horizontal axis.

  3. What shortcut opens the Macro dialog?

    Show answer

    Alt+F8.

  4. How do you copy all the macros in a module to another workbook?

    Show answer

    Drag the module between projects in the Visual Basic Editor, or export and import it.

Lesson quiz · 5 questions

Score 60% or more to complete this lesson.

Take the quiz