Dynamic X Axis to change showing certain years on Chart X axis values

Ronanm

Board Regular
Joined
Nov 13, 2010
Messages
107
Hi

I want a dynamic X Axis, that grow or shrinks based on whether or not there are values in a series.

E.G. A column chart which shows the number of students by year. The series changes based on a "Student Type" Drop down.

When "All" students are shown, the years 1990 - 2010 will have data (so this shows on the X avis), but with other selections, there may only be data for the years 2005 - 2010, whhich really should only show the years 2005, 2006, 2007, 2008, 2009 and 2010 on the X axis.

I have no problem adding a "Named rage" which uses offset to choose the series to show, it's just changing the X axis values which I can't work out.

Many thanks

Ronan
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.

Forum statistics

Threads
1,215,779
Messages
6,126,848
Members
449,343
Latest member
DEWS2031

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top