Two trendlines in one chart

RAM

Well-known Member
Joined
Oct 4, 2004
Messages
1,862
Here's the scenario:

One chart that is linked to two out of three columns, one with the dates (A) and one (C) that shows the left over inventory in the storage after what has been signed out in the second (B) column.

The chart is updated weekly.

The chart has a trendline and is updated manually and is not dynamic, yet at least, but I will probably make it dynamic.

I want the chart to have two, not only one, trendlines. One that represent the actual trend when the inventory will run out and one that shows the trend the previous week.

It sounds simple. Two ranges would do it. One range that includes all sign-outs in column C and another one that shows the same minus one weeks inventory, but I don't get it right.
Desert Passage storage Inventory chart.xls
ABCD
220952
311/1021620736630
411/1121620520420
511/127220448210
611/1314420304420
Data Trendline Chart


Thanks in advance

RAM
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
RAM said:
{snip}

It sounds simple. Two ranges would do it. One range that includes all sign-outs in column C and another one that shows the same minus one weeks inventory, but I don't get it right.
{snip}
How so? What does "I don't get it right" mean? You have the right idea and it should work. Are you including the dates when you plot the 2nd series? And, correctly excluding the last date?
 
Upvote 0
Thanks tusharm for your replay,

When I add the second series it takes over the first series and the first series is no longer displayed. I don't get two chart series or trendlines. I get one (of each). The trendline is series 1, but displays series 2's values. The chart line is series 2 and displays series 2's values. Then the ranges doesn't display anymore in the columns when I click on the chart. How will I then change the values without its getting too time consuming?

RAM
 
Upvote 0
Assuming you are adding the dates and the values, you are plotting the exact same data just one fewer element! Of course, it plots exactly on top of the first series.

To see this, double-click either of the series and from the Axis tab select Secondary axis. Now, you will see the 2 series shown to slightly different scale. If you don't change the scale of the secondary y axis so that you do.
 
Upvote 0
Tusharm,

I hope you're still watching this topic. I got another question and you must be the right person to ask this question.

I was just about to make the chart dynamic, but am running into the problem that I have two date series and need the second series to display the full date column minus 7 days. As per above postings the second trend line displays past weeks trend.

I have these formulas, and I believe I got them from your Web site:

=OFFSET('Basic Range'!YValues,0,-1)
=OFFSET('Basic Range'!$B$5,0,0,COUNTA('Basic Range'!$B:$B)-1,1)

They would work if I had only one date series, but I have two. Can these formulas be tweaked for my purpose?

TIA

RAM
 
Upvote 0
For the other series you should create two more names each with 1 fewer cell.

YVals2 =OFFSET('Basic Range'!$B$5,0,0,COUNTA('Basic Range'!$B:$B)-2,1)
XVals2 =OFFSET('Basic Range'!YVals2,0,-1)
 
Upvote 0
Your answer is untried as yet, but just to verify I have expressed myself correctly my sheet looks like this:
Book4
ABCDEFG
1Date8oz IATot1/2 oz IATot
2INOUT20952INOUT46200
311/141002162083621045990
411/15722076421045780
511/16020764045780
611/171442062042045360
711/181442047621045150
811/192882018842044730
911/20210722032615021044670
1011/21722025421044460
1111/222162003842044040
1211/233601967884043200
1311/241441953442042780
1411/25721946221042570
1511/2664818814126041310
1611/272101441888042042041310
Sheet2


I said "two date series", but I should have said "two date ranges".

Present weeks trend include all dated cells and prior week’s trend includes all dated cells, minus 7 days.

And not to confuse more, I have two charts for the above worksheet, one for 8 oz and one for 1/2 oz, but they share the date column (Edit): in each chart.

Thank you.

RAM
 
Upvote 0

Forum statistics

Threads
1,214,583
Messages
6,120,383
Members
448,956
Latest member
JPav

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