Quantcast
Channel: My Online Training Hub » charts
Viewing all articles
Browse latest Browse all 9

Excel Custom Chart Labels

$
0
0

Using Excel custom chart labels is a great way to create a more insightful chart without having to show a whole other series. Just take this chart below with custom labels showing the year on year % change:

Excel Custom Chart Label Example

Download the Excel Workbook. Note: this is a .xlsx file please ensure your browser doesn’t change the file extension on download.

Custom Chart Labels Excel 2013

In Excel 2013 we can easily insert custom chart labels using the new ‘Value From Cells’ option found in the Label Options menu:

Excel 2013 Custom Chart Labels

Unfortunately if you’re using Excel 2007 or 2010 you’re not so fortunate but fear not, I have a workaround.

Custom Chart Labels Excel 2010/2007

The Old Way:

I used to hijack the regular labels and replace them with links to cells containing the label I wanted, however there were three problems with this approach:

  1. They could only display numbers, which means I couldn’t do anything fancy like the up/down triangles in the chart above.
  2. It was tedious as they had to be linked one at a time and when you’ve got loads of labels….well, it gets boring fast.
  3. They didn’t dynamically update i.e. if the period of my chart changed I had to manually change my labels…double boring.

The workaround for this was to insert text boxes and link them to cells, however this also fell afoul of problems 2 and 3 above.

Bonus problem: aligning the text box labels wasn’t too bad if you wanted them along a straight line as you could just use the Alignment Tools, but if you want them staggered in line with the column height then you’ll be wasting valuable hours tediously moving boxes up and down. Yawn.

The New Improved Way:

Last week Karen asked me how to insert custom labels that dynamically update, so I spent a bit of time experimenting with the tools buried in the chart menus and figured out that I could hijack the horizontal category axis for my custom labels, and puff, just like that problems 1, 2, 3 and 4 are gone.

Here’s how: Set up your chart source data:

Excel Custom Chart Labels source data

Take special note of columns D and E as these are required for the labels.

A brief word on the Max column: this column simply returns the MAX from columns B and C for each row. We use Max as a dummy series in our chart to dynamically position the labels just above the columns.

Step 1: Select cells A26:D38 and insert a column Chart

Step 2: Select the Max series and plot it on the Secondary Axis: double click the Max series > Format Data Series > Secondary Axis:

Excel format data series

Step 3: Insert labels on the Max series: right-click series > Add Data Labels:

add data labels

Step 4: Change the horizontal category axis for the Max series: right-click > Select Data > select ‘Max’ from the Legend Entries and then click ‘Edit’ under ‘Horizontal Axis Labels’:

change horizontal category axis

Select the Labels in cells E27:E38 and click OK (image below):

axis label range

Don’t worry if the chart doesn’t look any different yet.

Step 5: Replace the default labels with your custom labels: right-click the labels > Format Data Labels:

replace labels with custom chart labels

From the ‘Label Contains’ list choose ‘Category Name’:

set category name

Step 6: hide the Max series columns by formatting them with ‘No fill’: double-click the Max columns in the chart to open the ‘Format Data Point’ dialog box and under the ‘Fill’ tab choose ‘No fill’:

hide series with no fill

Step 7: Tidy up the chart:

  • Hide the secondary axis – double click it to open the Format Axis dialog box > Axis Options > Axis Labels, Major and Minor tick marks > set all to ‘None’:
  •  

    hide secondary axis

  • While in the Format Axis dialog box go to the ‘Line Colour’ tab > select No Line
  • Move the legend to the bottom: double click the legend > legend position > Bottom
  • Get rid of the gridlines – just select them and press the Delete key.
  • Format the legend point for Max to pick up the value in cell E26: right-click the columns > Select Data > select Max from the Legend Series list > Edit:
  •  

    fix legend label

    In the Series name field click on cell E26 > click OK:

    set series name

Celebrate! Your custom chart labels are complete:

Excel Custom Chart Label Example

Thanks

Thanks to Karen for prompting me to discover this workaround. Although, I’m sure I’m not the first to use this technique, I’ve not stumbled upon it before.

Please Share

If you liked this or know someone who could use it please click the buttons below to share it with your friends on LinkedIn, Google+, Facebook and Twitter.

The post Excel Custom Chart Labels appeared first on My Online Training Hub.


Viewing all articles
Browse latest Browse all 9

Latest Images

Trending Articles





Latest Images