Excel Test - Create trend line from data set

ickelly

New Member
Joined
Dec 9, 2013
Messages
14
I am stumped by a question on a potential employer's Excel test. The objective is to create a graph showing each particular product's percentage of total month's sales, for a 12 month period. The data set is thousands of lines, each showing sales for each month for a particular product in a specific region (sample below). I started by creating a pivot table of the data set, that totaled sales for each product, by month. This was fairly straightforward. The trouble came when I wanted to create the graph with the trend line showing the percentage of net sales for the month that each product contributed. The instructions were to create one chart with trend lines showing each Product's performance over time, with vertical axis labeled as percentage of total sales, and the horizontal axis showing months (e.g. Month 1, 2, 3…etc). The lines are to be stacked and color coded with a legend identifying each line and the Product it represents. I tried adding a calculated field to the pivot table, but wasn't able to get the percentage of total sales. The original data set is in the format of the example below. Any ideas/help is greatly appreciated. - Thanks.

ProductRegionMonth 1Month 2Month 3Month 4Month 5Month 6Month 7Month 8Month 9Month 10Month 11Month 12
Prod 1NE456678etc..
Prod 1NW567453etc..
Prod 2NE7756etc..
Prod 2SE565345etc..
Prod 2SW567356etc..
Prod 3NW56736etc..
Prod 3SW89356etc..
Prod 4NE45634etc..
Prod 4MW6734etc..

<tbody>
</tbody>
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
Hi ickelly,
In your thread you wrote :
I tried adding a calculated field to the pivot table, but wasn't able to get the percentage of total sales.
here is the solution (which I hope will give you a good start).
The "sum of amount" in the pivot table can be changed by Value Field Settings to show values as % of Row Total rather than plain Sum, as shown in the attached sample.
All the best,
Eli

Excel 2010
Row\Col
A
B
C
D
E
F
G
H
I
J
K
L
1
prod
region
month
amount
2
p1​
ne​
m1​
12​
Sum of amountmonth
3
p1​
ne​
m1​
24​
prodm1m2m3m4Grand Total
4
p1​
nw​
m1​
50​
p1
106​
107​
140​
127​
480​
5
p1​
nw​
m1​
20​
p2
100​
116​
97​
133​
446​
6
p1​
ne​
m2​
11​
Grand Total
206
223
237
260
926
7
p1​
ne​
m2​
23​
8
p1​
nw​
m2​
32​
9
p1​
nw​
m2​
41​
10
p2​
ne​
m1​
20​
Sum of amountmonth
11
p2​
ne​
m1​
51​
prodm1m2m3m4Grand Total
12
p2​
nw​
m1​
22​
p1
22.08%​
22.29%​
29.17%​
26.46%​
100.00%​
13
p2​
nw​
m1​
7​
p2
22.42%​
26.01%​
21.75%​
29.82%​
100.00%​
14
p2​
ne​
m2​
64​
15
p2​
ne​
m2​
20​
16
p2​
nw​
m2​
20​
17
p2​
nw​
m2​
12​
18
p1​
ne​
m3​
30​
19
p1​
ne​
m3​
14​
20
p1​
nw​
m3​
54​
21
p1​
nw​
m3​
42​
22
p1​
ne​
m4​
15​
23
p1​
ne​
m4​
52​
24
p1​
nw​
m4​
24​
25
p1​
nw​
m4​
36​
26
p2​
ne​
m3​
14​
27
p2​
ne​
m3​
40​
28
p2​
nw​
m3​
21​
29
p2​
nw​
m3​
22​
30
p2​
ne​
m4​
31​
31
p2​
ne​
m4​
40​
32
p2​
nw​
m4​
8​
33
p2​
nw​
m4​
54​
Sheet: Sheet1
 
Upvote 0
you can select a dataset on the chart and then add a trend directly from the right click menu (there are a number to choose from, and you can change the colour also directly)
 
Upvote 0

Forum statistics

Threads
1,214,971
Messages
6,122,520
Members
449,088
Latest member
RandomExceller01

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