Create Line chart by Week

michung

New Member
Joined
Nov 19, 2014
Messages
17
Hi

How can I create a Line Chart by Week for the following data:

Date WTI Price US$
01-09-2014 94.96
02-09-2014 92.88
03-09-2014 95.54
04-09-2014 91.45
05-09-2014 93.29
06-09-2014 93.29
07-09-2014 93.29
08-09-2014 92.66
09-09-2014 90.01
10-09-2014 90.20
11-09-2014 89.54
12-09-2014 90.25
13-09-2014 90.25
14-09-2014 90.25
.....
.....
30-09-2014 91.50

The X-Axis Date type only allows Resolution by Date/Month/Year.

We would like to view the chart by Weeks.

We do NOT want to use the Days resolution where the major interval is 7.

Is there a method to get the chart represented by weeks?
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
Note that I do NOT want to group by week and sum by WTI per week. Instead of seeing the 7 days per week in the x-axis, I would like to see Week# and the corresponding 7 points on the line chart which represents the 7 days of the week. It is a bit difficult when viewing the x-axis with the 30-31 days. The use of the Days resolution where the major interval is 7 is breaking the dates into 01, 08, 15, 22, 29. Is there any way to showing the week # instead of day?
 
Upvote 0
This is because Excel thinks it is smarter than you, I have just been through the very same thing myself.

My way around it was to make a helper column referencing the date with a formula for example =TEXT(A1,"DD/MM/YYYY") or whatever format you want and then chart on that and your data, then it will plot the points without trying to add days between.

Edit: Oh wait, you want to sum based on your week?

Similar concept but use this formula:


Excel 2010
AB
11-Jan1
22-Jan1
33-Jan1
44-Jan1
55-Jan2
66-Jan2
77-Jan2
88-Jan2
99-Jan2
1010-Jan2
1111-Jan2
1212-Jan3
1313-Jan3
Sheet1
Cell Formulas
RangeFormula
B2=IF(WEEKDAY(A2)=1,B1+1,B1)
 
Last edited:
Upvote 0
Hi Blade

Thanks for the response. Previously what I did was entered the week number manually per row. However, the chart x-axis is displaying 1 1 1 1 2 2 2 2 2 2 2 3 3 3 3 ... etc.
Is there any way to just show 1 2 3 4 .... etc with the corresponding WTI?

Regards
Michelle



This is because Excel thinks it is smarter than you, I have just been through the very same thing myself.

My way around it was to make a helper column referencing the date with a formula for example =TEXT(A1,"DD/MM/YYYY") or whatever format you want and then chart on that and your data, then it will plot the points without trying to add days between.

Edit: Oh wait, you want to sum based on your week?

Similar concept but use this formula:

Excel 2010
AB
11-Jan1
22-Jan1
33-Jan1
44-Jan1
55-Jan2
66-Jan2
77-Jan2
88-Jan2
99-Jan2
1010-Jan2
1111-Jan2
1212-Jan3
1313-Jan3

<tbody>
</tbody>
Sheet1

Worksheet Formulas
CellFormula
B2=IF(WEEKDAY(A2)=1,B1+1,B1)

<tbody>
</tbody>

<tbody>
</tbody>
 
Upvote 0
So do you want to sum the WTI per week or show the week on the X axis on only the first daily WTI on the chart for that week?
 
Upvote 0
Hi Blade.

No... I do not want to sum the WTI per week.

What I would like to see on the chart is:

X-axis =

week 1 plot against WTIs

94.96
92.88
95.54
91.45
93.29
93.29
93.29

week 2 plot against WTIs

92.66
90.01
90.20
89.54
90.25
90.25
90.25
.....

I just don't want to see the week repeating on the x-axis.

I've tried creating a series table. The only thing I did not like with this is that there is a break in the linear line per week ... but this was the closest where I can show a representation of the weekly trend of WTI. The main concern was that with the original table with the 30 days on the x-axis made the chart look too cluttered ... so I was hoping to show by weeks 1 2 3 4 ... for better presentation instead of the 1 to 30 days on the x-axis.

DATE WK1 WK2 WK3 WK4 WK5
0194.96
0292.88
0395.54
0491.45
0593.29
0693.29
0793.29
0892.66
0990.01
1090.20
1189.54
1290.25
1390.25
1490.25
1592.92
1694.88
1794.42
1893.07
1992.41
2092.41
2192.41
2291.52
2391.56
2492.80
2592.53
2693.54
2793.54
2893.54
2994.57
3091.16

<colgroup><col width="79"><col width="79"><col width="79"><col width="79"><col width="79"><col width="79"></colgroup> <tbody>
</tbody>






 
Upvote 0
OK so the easy option as I see it is where you have a formula to populate a column with the week number just wrap it in a formula so if the result is the same as above then display "" otherwise display the result.

It will give you something like this:

Excel 2010
ABC
1DATEWTIWK
2194.961
3292.88
4395.54
5491.45
6593.29
7693.29
8793.29
9892.662
10990.01
111090.2
121189.54
131290.25
141390.25
151490.25
161592.923
171694.88
181794.42
191893.07
201992.41
212092.41
222192.41
232291.524
242391.56
252492.8
262592.53
272693.54
282793.54
292893.54
302994.575
313091.16

<tbody>
</tbody>
Sheet1

Worksheet Formulas
CellFormula
C2=IF(MOD(A2,7)=1,MAX(C$1:C1)+1,"")

<tbody>
</tbody>

<tbody>
</tbody>

Change =1 to a =4 to move the label to the middle of the column, then in your axis options set your tick marks to every 7
 
Upvote 0
:cool: Thanks Blade ... I did the same thing (without the formulas though) to get the week to show only once. Was not sure what I was doing was right though although it made my presentation better.

I would try using the two functions you have provided, and try creating a dynamic monthly chart at the same time.

Hmmm .... to make it even more complex, is there a way to get a vertical line drawn on the chart at the end of a week or maybe colour code by week?

The user asked if a line can be drawn at the end of the working week / and weekend or public holiday. I know that this is much more complex in the design of the chart. WTI prices are only given on working days except weekends or public holidays ... thus we tend to use the WTI figure from the previous day. The easy solution here I can think of is using draw objects to separate the weeks ... weekends. Any suggestions to automate this?






OK so the easy option as I see it is where you have a formula to populate a column with the week number just wrap it in a formula so if the result is the same as above then display "" otherwise display the result.

It will give you something like this:

Excel 2010
ABC
1DATEWTIWK
2194.961
3292.88
4395.54
5491.45
6593.29
7693.29
8793.29
9892.662
10990.01
111090.2
121189.54
131290.25
141390.25
151490.25
161592.923
171694.88
181794.42
191893.07
201992.41
212092.41
222192.41
232291.524
242391.56
252492.8
262592.53
272693.54
282793.54
292893.54
302994.575
313091.16

<tbody>
</tbody>
Sheet1

Worksheet Formulas
CellFormula
C2=IF(MOD(A2,7)=1,MAX(C$1:C1)+1,"")

<tbody>
</tbody>

<tbody>
</tbody>

Change =1 to a =4 to move the label to the middle of the column, then in your axis options set your tick marks to every 7
 
Upvote 0
There is, I can't exactly remember how but from memory you make it another series on the chart. I will see if I can dig something up on it. I think I might have even made it a number that was bigger than my max Y axis then made it a really really thin bar on just that series.
 
Upvote 0
Okay. Tomorrow then... It's already 11:33 pm over here :( ... time for some zzzz's. Thank you again.


There is, I can't exactly remember how but from memory you make it another series on the chart. I will see if I can dig something up on it. I think I might have even made it a number that was bigger than my max Y axis then made it a really really thin bar on just that series.
 
Upvote 0

Forum statistics

Threads
1,214,653
Messages
6,120,755
Members
448,989
Latest member
mariah3

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