What Is a Waterfall Chart and Why Would I Need One

Last month your revenue was $40,000 and this month it’s only $30,000? What happened? In Excel, you could print a nice report that shows each revenue stream for last month and this month, so you can compare the amounts.

Waterfall01

You could even create a bar chart to compare the different revenue streams.

Waterfall02

The bar chart lets you see the differences for each stream, but maybe you’d like to see how each revenue stream contributed to the overall change in revenue.

A waterfall chart will let you see the changes that occur between a starting point and an ending point. In Excel, you can create a waterfall chart by building a column chart, and making some changes to it.

Create a New Table

The first step in building a waterfall chart is to create a table that calculates the individual changes, and a running total. In the example below:

  • June and July revenues are at the far right.
  • F3 is the total for June.
  • C9 is the total for July.
  • Column D shows the difference, where amounts have gone down.
  • Column E shows the difference, where amounts have gone up.
  • Column B is the running total, from the June start, to the July end.

Waterfall03

Add a Column Chart

To start the waterfall chart, select the range in the thick border (A1:F10), and insert a clustered column chart.

Waterfall04

Hide the Running Total

To focus on the revenue stream changes, you can hide the series for the running total:

  • Click on a dark blue column, to select the Run Ttl series
  • On the Ribbon’s Format tab, for Shape Fill, select No Fill

To remove the Run Ttl series from the legend:

  • Click on the legend to select it
  • Click on Run Ttl, then press the Delete key

Waterfall05

Format the Waterfall Chart

Next, you can add a bit of formatting to make the column chart look more like a traditional waterfall chart. To widen the columns:

  • Right-click on any column, and click Format Data Series.
  • In the Series Options category, set the Gap Width to 0%.
  • Close the dialog box.

Waterfall06

To lighten the gridlines:

  • Right-click on a gridline, and click Format Gridlines.
  • In the Line Color category, select Solid Line.
  • From the Color drop down list, select a light shade, such as the lightest grey.
  • Close the dialog box.

In this revenue chart, up is good, and down is bad, so you can change those series colors to red and green. If the End series is red, change it to a different color, to avoid any confusion. To change a series colors:

  • Click on a column, to select its series
  • On the Ribbon’s Format tab, for Shape Fill, select the color you want

And here’s the finished waterfall chart. I also added data labels with a custom number format, to show up and down arrows.

Waterfall07
________________

Create Excel Pivot Table from Multiple Sheets

A common pivot table question is “How can I create a pivot table from data that’s on separate sheets in my workbook?

Sometime people have a workbook set up with a separate sheet for each region, or for each salesperson.

Eventually, they want to pull all the data together, and create a summary report in a pivot table, from multiple sheets.

Continue reading “Create Excel Pivot Table from Multiple Sheets”

Number Excel Comments for Printing

If you add comments to an Excel worksheet, you might want to include those comments when printing. There are a couple of built in options for printing comments, but neither is ideal.

We’ll look at those options first, then a numbering system, that’s similar to numbered footnotes.

The Built In Options

In the Page Setup dialog box, on the Sheet tab, there are 3 options for printing the comments:

  • (None)
  • At end of sheet
  • As displayed on sheet

CommentPrintOpt

Print At End of Sheet

If you select At end of sheet, a separate page of comments prints, listing the cell address, commenter name and comment text.

separate page of comments prints
separate page of comments prints

As Displayed on Sheet

If you select As displayed on sheet, the comment that are currently visible on the worksheet will print, exactly as they appear on screen.

That might work if there are a couple of comments that you want to show, and can arrange them over an empty space. Otherwise, you’ll end up with a jumbled mess of comments, covering your data.

Print Comments As Displayed on Sheet
Print Comments As Displayed on Sheet

Add Numbers to Cells With Comments

Instead of using either of the built in options to print comments, you could use a bit of programming to add a tiny number at the top right of each cell that has a comment. Here’s a close up view of the numbered cells.

CommentsNum01

List the Numbered Comments

With another bit of programming, you can create a numbered list of the comments, with other details, such as range name, cell value, cell address and comment text.

CommentPrintList

This list is on a separate worksheet, that you can print when you print the sheet with comments.

Download the Sample File

To download the sample file for Excel 2003 or Excel 2007/2010, go to the Number and List Comments section on the Comments programming page. There’s sample code to add numbers, remove numbers and list the comments, and a zipped sample file that you can download.

The Excel 2003 numbering code didn’t work well in Excel 2007. The numbers didn’t appear in some boxes, and the boxes didn’t line up correctly in the cells. So if you’re using Excel 2007, be sure to download that version’s sample file

Both files contain macros, so you may get a warning when you open them. Enable the macros if you want to run the code.
__________

Click a Map To Filter Excel Data

In the steps below, I’ll show how to set up an Excel workbook so you can click on a map, and see a list of fictional doctors in the state that you selected. There’s also an Excel sample file that you can download, and try this map technique for yourself!

Click state on map to get list of fictional doctors
Click state on map to get list of fictional doctors

Set up the Map

First, I found a clip art map of the continental USA, with a separate shape for each state, and pasted that into a workbook.

Next, I named the shapes, using the two digit state abbreviation.

  • Click on a state shape, e.g. Washington
  • Click in the Name Box, and type the two digit code – WA
Map of USA with state shapes
Map of USA with state shapes
  • Press the Enter key, to complete the naming.

This will be a good test of your geography knowledge and state abbreviation skills.

Set Up the List of Doctors

On a sheet named Doctors, I entered a list of fictional doctor names, state codes and number of patients.

list of fictional doctor names
list of fictional doctor names

I named the range, DoctorList, using the formula:

  • =OFFSET(Doctors!$A$1,0,0, COUNTA(Doctors!$A:$A), COUNTA(Doctors!$1:$1))

as described in my Dynamic Named Ranges tutorial.

Use an Excel Advanced Filter

To get a list of doctor names for a specific state, I’ll use an advanced filter, and a macro to run the advanced filter.

To use an advanced filter, I’ll set up two ranges in the workbook:

  • 1) Filter Criteria Range
  • 2) Filter Extract Range

Those two steps are explained in the sections below.

1) Set Up the Filter Criteria

On the Map sheet, I set up a criteria range for the filter, with the State heading in cell A1, and a State code in cell A2.

To name this range, I selected cells A1:A2 and typed Criteria in the Name box, then pressed the Enter key.

type Criteria in Name box
type Criteria in Name box

2) Set Up the Filter Extract

Next, to create an extract range, I copied the headings from the Doctor list, and pasted them below the map.

With the pasted cells still selected, I named that range StateList.

This is where the list of fictional doctors will appear, after you click a state in the map.

create an extract range
create an extract range

Add the Filter Macro

To “magically” create the list when the map is clicked, I needed an Excel macro.

So, I added a module to the workbook, and entered some VBA code, shown below.

The macro. named GetDoctorList, uses an Advanced Filter, to extract a list of doctors for the selected state.

Sub GetDoctorList()
On Error Resume Next
Dim strState As String
Dim sh As Shape
Dim wsMap As Worksheet
Dim wsDoctor As Worksheet
Dim wsList As Worksheet
strState = Application.Caller
Set wsMap = Worksheets("Map")
Set wsDoctor = Worksheets("Doctors")
wsMap.Range("A2").Value = strState
wsDoctor.Range("DoctorList").AdvancedFilter _
  Action:=xlFilterCopy, _
  CriteriaRange:=wsMap.Range("Criteria"), _
  CopyToRange:=wsMap.Range("StateList"), Unique:=False
wsMap.Activate
wsMap.Range("A1").Activate
End Sub

Assign the Macro to Shapes

The final step is to assign the GetDoctorList macro to each State shape in the USA map.

You could do this manually, if there were just a few shapes:

  • Right-click on each shape
  • Click the Assign Macro command
  • Select the GetDoctorList macro
  • Click OK

Macro to Assign Macros

It might take quite a while to assign the GetDoctorList macro for all 48 states!

So, I wrote another macro, to do the work for me.

You’ll only have to run this macro once, while setting up the workbook.

The macro is only a few lines long, and it assigns the GetDoctorList macro to each shape on the worksheet named Map.

Sub AddMacro()
Dim sh As Shape
For Each sh In Worksheets("Map").Shapes
    sh.OnAction = "GetDoctorList"
Next
End Sub

Run the Filter

Now, to run the filter, you can click on a state in the map.

When the GetDoctorList macro runs, it does the following steps:

  • First, it puts the state code in cell A2
  • Next, the macro runs an advanced filter, which puts the list of doctors in the extract range, starting in cell B18.

The criteria range, and the extracted list are shown in the screen shot below.

The state shape for California (CA) was clicked, and the filtered list shows the fictional doctors from California.

click on a state in the map
click on a state in the map

Get the Sample File

To get the Excel sample file with the USA map and list of fictional doctors, go to the Excel Filter Sample Files page on my Contextures site.

  • On that page, go to the section named: Filter Files FL0011 – FL0020
  • In that section, look for the sample file named FL0012 – Map Based Filter, and click its download link.
  • The zipped Excel contains macros, so be sure to enable those, if you want to test the map filter macros.

More Excel Filter Examples

Excel FILTER function

Advanced Filter Basics

Advanced Filter Criteria

Advanced Filter Macros

Advanced Filter Criteria Slicers

_________________

Favourite Free Excel Add-Ins

Excel is certainly packed with features, but I use a few free add-ins that make Excel even better.

[Update] I’ve created a list of all the free Excel add-ins that were suggested in the comments. Thanks for sharing your favourites!

Name Manager

by Jan Karel Pieterse of JKP Application Development Services
If you use names in Excel, you need this tool. You can quickly find names with errors and delete them, or track names that link to another workbook.

There are many more features, so download Name Manager, and see what it can help you with.

Excel Name Manager Filters
Excel Name Manager Filters

Excel Utilities

by Rob Bovey of AppsPro

Rob’s add-in has handy tools for working with named ranges, worksheets and selections.

You can quickly protect and unprotect all the sheets in a workbook, remove unused styles, and my favourite – centre across a selection, without merging cells.

There are many more features, and you can read the full description on Rob’s page for Excel Utilities.

Excel Utilities drop down menus
Excel Utilities drop down menus

Pivot Power

Since I work with pivot tables so often, I created my own pivot table add-in, that you can download.

The commands that I use most often are Clear Old Data, and Sum All Data.

PivotAddIn

Your Favourite Free Excel Add-Ins

What are your favourite free add-ins for Excel? Any of the ones that I’ve listed? Have you created some of your own?
_________________

Find Answers to Excel Questions

Where do you go when you’ve got an Excel question?

Survey: Where to Find Excel Answers

A while ago, I recommended the Excel newsgroups as a great place to ask questions and get one (or several) solutions. Is that what you use, or something different?

Let’s try a quick survey – it’s my first attempt, so fingers crossed that it goes smoothly! If you answer “Other”, you can add details in the comments, if you’d like.

UPDATE: The poll has closed.

Where I Find Answers

For quick questions, I usually use Google, either a general search, or a newsgroup search.

Next, if nothing turns up in Google, the Microsoft Knowledgebase is my next option, in most cases.

Occasionally, if really stumped, I’ll email a colleague for help.

Excel Books

I have a good collection of Excel books that I use too.

Some are excellent reference books, with a good index, and markers on the pages that I turn to frequently.

Others are more for inspiration, and learning new things, than for research.

Excel books on my office bookshelf
Excel books on my office bookshelf

Your Excel Books

There’s a list of Excel books on my website, divided into categories. If you use any of those, I’d love to know what you think of them.

Are there any Excel books you’d recommend, that are missing from the list?
_________________

Highlight Items in 2 Excel Lists-Conditional Formatting

If there are any typos in this blog post, blame my maple syrup related injury. Sunday morning, I tried to clean a few drips from the syrup jug, and ended up with a puncture wound.

Those crystallized bits are razor sharp, so don’t put your delicate typing fingers anywhere near them. Maybe it’s just a Canadian hazard!

List of Excel Files

Bravely carrying on, I was updating some files, and keeping track of the updates in Excel.

On a sheet named All_Files, I have a list of all the files, and the number of downloads for each file.

FileListAll01

On the Files_Updated sheet, I have a list of files that have been updated.

list of updated Excel files
list of updated Excel files

Mark Duplicate Entries With Conditional Formatting

When looking at the full list of files, I’d like a quick way to identify the files that have been updated.

The actual list is pretty long, and my faulty memory only works for the first few updates. After that, I can’t really remember which ones have been done.

See the written steps, and an Excel video, in the sections below

Use Formula to Count Duplicates?

I could add a new column, with a COUNTIF formula to count the number of times each file appears in the Update list.

Instead, I’ll use conditional formatting to colour the rows for files that have been updated.

Highlight Duplicate Items

Just like data validation, conditional formatting complains if you try to refer to cells on another worksheet.

So, I’ll name the range on the Files_Updated sheet, and refer to the named range.

For some reason, Excel is okay with references to named ranges on another sheet.

Name the Range

To name the range:

  1. On the Files_Updated, select column A
  2. Click in the Name box, and type a one word name for the range – UpdateA in this example.
  3. Press the Enter key, to complete the naming.
Name the Range
Name the Range

Add the Conditional Formatting

Next, add the conditional formatting to the list of all files.

  • On the All_Files sheet, select the cells that contain the file names and download quantities.
  • On the Ribbon, click the Home tab

Click Conditional Formatting, then click New Rule.
CondFormatNewRule

Create Conditional Formatting Rule

  • In the New Formatting Rule dialog box, click Use a formula to determine which cells to format
  • In the formula box, enter a COUNTIF formula, referring to the named range on the Updates sheet, and to the active cell on the All_Files sheet. Use an absolute reference to the column, $A. In this example, the formula is:
    =COUNTIF(UpdateA,$A2)

    CondFormatUpA
  • Click the Format button, and select the formatting you want for the highlighting.
  • Click OK, twice, to close the dialog boxes.

The rows for the files that have been updated are now highlighted.

CondFormatUpGreen

You can quickly see which files are done, and concentrate on the files that still need to be updated.

Watch the Video

To see the steps in action, you can watch the following short video.

____________________

Summer Giveaway for Excel Nerds Winners

Thanks for participating! You’re an awesome bunch of Excel nerds. The entries in the “You might be an Excel nerd…” giveaway were very entertaining, and read more like my resume than a list of contest entries.

Yep, I do some of those things, and I’ll bet you do too. 😉
Thanks again to the generous prize donors:

The Draw

As promised, I did a random draw of prizes and entries. But, in true Excel nerd fashion, I didn’t just drop the names into a hat. No, that might have only taken 5 minutes or so. Instead, I wrote a macro to do the draws for me.

Before the draw, I cleaned up the list of entries, removing the people who said they weren’t participating, and deleting any extra entries per person. I kept the comment numbers with the names, and created a numbered list of prizes, based on the order they appeared in the original giveaway post.

I set up a list to record the draw number, prize number and entry number, then ran the macro. There was even a drum roll at the start of the draw, but it was disappointingly quiet. Oh well, at least everything else went smoothly.

You’d probably do it differently, and maybe without the drum roll, but if you’d like to see the macro that I used, you can download the Draw Macro Sample file. Now you’ll be able to organize your own giveaways!

And the Winners Are…

After the numbers had been selected, I used a couple VLOOKUP formulas to pull the prize names and winner names from the original lists of numbered prizes and entries. Congratulations to all the winners! Here’s the list:

Giveaway20090729_Win

Collect Your Prize

I’ll send an email to all the winners on July 29, 2009, with instructions for claiming your prize. Please reply by 5 PM EDT on Monday August 10, 2009, or your prize will be put back into the vault for the next giveaway.

Note: Some of the prize donors will be away from their offices in August, so there may be a delay in mailing.

Update: I’ve sent out the emails, using the email address that you used in your comment. If you haven’t received your email, please let me know at ddalgleish @ contextures.com

______________

Prevent Excel Dependent Drop Down List Problems

You know how to create a drop down list in Excel, by using the Data Validation feature.

Sometimes you get extra fancy, and make a drop down list that depends on the selection made in another list, using dependent data validation.

Excel Dependent Drop Down Lists
Excel Dependent Drop Down Lists

Dependent Drop-Down List Problem

Dependent data validation works well, but there’s a loophole.

In the screen shot below, I can change the category to Fruit, even though a vegetable, Cabbage, is selected as the Item in that row.

With this loophole, you could end up with some strange data on your worksheet!

Changing Category Selection
Changing Category Selection

Lock the First List

Excel users are very resourceful, and can find ways around almost every safeguard that you set up.

However, you can slow them down a bit, by making the first list dependent on the second.

They’ll have to clear the Item selection before they can change the Category.

Currently, the Category cells have a data validation list that’s based on the named range, Produce.

DVProdDialog

Change Data Validation Formula

You can change the formula in the Source box, so it only uses the Produce range if the Item cell is empty. In the screen shot below, cell B2 is active, and the Data Validation Source formula is:

=IF(C2=””,Produce,B2)

Change Data Validation Formula
Change Data Validation Formula

Cannot Change Category

If cell C2 is empty, the Produce list will show in the drop down list.

If an Item was selected in cell C2, then the drop down list will show contents of cell B2.

drop down list shows cell contents only
drop down list shows cell contents only

Highlight Any Inconsistencies

It’s still not foolproof. Users could clear the Category cell, then enter any value. Or they could cut and paste from another cell.

As an extra precaution, you could add conditional formatting in column C, to turn the cells yellow if the selected Item is not in the selected Category.

With cell C2 active, the conditional formatting formula is:

=COUNTIF(INDIRECT(B2),C2)=0

conditional formatting formula to highlight mismatches
conditional formatting formula to highlight mismatches

The bright yellow colour will alert users if there’s an inconsistency in the selections, and make it easier for you to spot any problems.

Highlighted Items

For example, in the following screen shot, Cabbage and Rutabaga are highlighted in yellow, because the Category has been changed to Fruit.

Those items don’t appear in the range named Fruit, so the COUNTIF formula returns a zero.

conditional formatting highlights mismatches
conditional formatting highlights mismatches

[Update] Video: Block Dependent Drop Down Changes

This short video shows another way to block people from changing the first drop down list, if there’s a selection in the second drop down.

There are written steps, and a sample file on the Advanced Dependent Drop Down Lists page, on my Contextures site.

_________________