Stop line chart when values =0 or blank

mactoolsix

Board Regular
Joined
Nov 30, 2010
Messages
105
I'm creating a template, so the data varies from user to user.
I want to include a line chart, however when one user's data stops earlier than another's, the graph ends up with a long line graph of zero.
Is there a way to stop the line graph when the value is zero?
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
Hello,

One way is to create a different source of data, whereby you have a formula showing #N/A instead of 0

i.e. =IF(B1=0,#N/A,B1)

Graphs don't show for #N/A.

Does this solve your problem?
 
Upvote 0
I tried your suggestion. The problem is the chart horizontal axis is years. The possible data contains 2018 through 2099, however some clients only need 2018 to 2050 or 2060. I end up with a graph for 2018 to 2050 and then a blank graph with a flat line from 2050 to 2099 which is about 1/2 the graph. If only 2018 to 2050 is used, I'd like the chart's horizontal axis to span only 2018 - 2050.

Thanks for the suggestion!
 
Upvote 0

Forum statistics

Threads
1,214,819
Messages
6,121,727
Members
449,049
Latest member
MiguekHeka

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