How to build Stacked graphs in Excel not amounting to 100% - excel

If I have a data :
year Total Balance subset 1 subset 2
1 100 50 20
2 300 200 175
3 200 65 35
4 50 25 5
Can i have a stacked column graph with "year" on X-Axis and the Y-Axis should be the balances- maximum being Total Balance and subset 1 and subset 2 be stacked within the Total Balance?

No direct way, however by transforming your values you can do it:
insert new columns with formula: =C2*$B2/SUM($C2:$D2)
insert your chart based on the new columns

Yes, assuming I got right what you need: insert the graph manually, and select your year values on the axis labels box (right side) and add each column (Total Balance, subset 1, subset 2) individually on the left side box.
Here's what I got
And here's my 'Select data' windows (sorry it's in portuguese)

Related

Excel Pivot Table: Different Subtotals for Different Value Fields

I have an excel pivot table with two summed field values. I need to subtotal the first one using sum and the second one using average. Here is the desired output:
Region
State
SumOfSales
SumOfUnitsSold
A
NY
100
5
A
NJ
200
3
A Subtotal
300
4
B
FL
250
4
B
GA
300
2
B Subtotal
550
3
So far the closest thing I've been able to find is a custom subtotal through the field settings for Region. But this adds two rows for subtotals. Any ideas?

Graph grouping by and percentages

I want to create a chart in Excel but I don't know how is it possible having the table below:
ID | MODEL
==========
1 LG-1
2 HP-2
3 HP-2
4 HP-2
5 LG-1
6 GE
7 HP-1
8 HP-1
9 HP-2
10 HP-2
The result I need is a graph showing the percentage of each model in the table
e.g. in any chart:
LG-1 = 20 %
GE = 10 %
HP-1 = 20 %
HP-2 = 50 %
Somewhere the relative counts of groups (i.e. their percentage shares) need to be calculated so I suggest for Excel 2013 selecting your data range (including labels) and clicking on INSERT > Charts - PivotChart (the down arrow) and PivotChart then select Existing Worksheet entering a suitable Location: and OK. In PivotChart Fields, drag ID to VALUES and MODEL to AXES. Click on the arrow next to Sum of ID, change to Count of ID and click on Value Field Settings..., on Show Values As and select Show values as "% of Grand Total", OK.
This way I end up with:

How to plot multiple grouped data in one excel scatter plot with lines

I am facing some difficulties with plotting grouped data (by index) in one graph (scatter plot with lines) in Excel, and I will appreciate a lot your help.
My data are in three columns:
The first column is the index of the data or the group (i.e. a unique number for every set of data)
the second column is the time
and the third column is the data
Group, Time, Data
1 1 12
1 3 12
1 4 28
1 8 56
1 12 37
1 24 40
1 48 34
2 0 7
2 1 14
2 4 6
2 8 63
2 12 4
2 24 35
2 48 3
und so on.
and I want to plot the data vs. time for each index i.e. data group alone, but on the same graph.
Until now, I was always doing it manually by adding each data set separately to the graph. But I think there should be a more clever and easier way to do it, especially that sometimes I have a lot of data (index number can reach 70 or 80).
Thanks a lot in advance.
You can create a pivot table on all your data. Use 'Group' as column headers and 'Time' as row headers. The resulting pivot table will have all time points from all groups as rows and your groups as columns. Each columns of course has entries only at these time points which are included in its group. The other cells are empty. If you just select the data range of this pivot table without column headers, you can get charts from the data as a plot chart omits empty cells.
Update
That is the result pivot table of your test data. The sorted data are in the red frame. (Forget the total results)
A way to do this in Excel 365 is:
Select the data
Go to Data -> From Table/Range to open the Power Query editor
Select the columns with grouped data
Select Transform -> Pivot Column
Select the column with the values corresponding to the grouped data
Under Advanced Options change the value aggregation to Don't aggregate
Click OK, then Home -> Close and Load
This should give you the data formatted in such a way that you can select it and create a chart as normal.

How to calculate average of a column of numbers linked to each frequency bin making up a histogram, Excel 2010?

I have three columns. Column A consists of numbers, column B consists of bin ranges, and column C consists of number data relevant to the individual data in column A.
Using columns A and B, I created a frequency histogram where all the data in column A have been grouped into the bins of column B. I would like to calculate the average value of each bin using the data from column C (i.e., calculate a mean value for each bin using data from column C that is associated to each value (from column A) that made up each bin).
Can anybody help?
Thanks for the replies. Here is an example of the data (Unfortunately I can not paste in images):
Below are three columns with headers Jar Type (in volume (ml)), Cookies (he number of chocolate chip cookies in the jar), and Interval for bins (bins to count the jar types):
Jar type-cookies-intervals for bins
500 3 100
500 1 150
500 0.5 200
250 3 250
150 1 300
500 1 350
150 2 400
250 2 450
### # 500
Making a histogram of the frequency of jar types gives this grouping:
Bin-Frequency
100 0
150 2
200 0
250 2
300 0
350 0
400 0
450 0
500 4
More 0
Now what I am trying to do is to find out what is the mean number of cookies that can be found in each type of jar. For example, for the 500ml we know that there are 4x500ml jars, and that in each of the 500ml we have 3+1+0.5+1 = 5.5 cookies in total. the mean would be 1.735 cookies.
My issue is that I have 5000+ numbers that separate into 100 bins.
The question calls for a "wandering trace" of a scatterplot: the values of column A (plot them on the horizontal axis) are placed into bins, which therefore comprise vertical strips in the scatterplot. The values of column C (plotted on the vertical axis) are averaged within each strip. This technique smooths out and summarizes apparent trends in the scatterplot.
In this example with 100 records the original data are in black and computed values are in green. Here is the wandering trace of means:
The open circles plot column C (associated values) against column A (data) while the solid squares, connected with a dashed red trace, plot the bin means (column G) against the midpoints (column F).
Any statistical package will provide functions for grouping data and performing operations on those groups. Excel does this to a limited extent with its SUMIF and COUNTIF functions. To use them, create a column (D in the spreadsheet) showing the grouping factor. (That's a simple lookup in the sorted BINS vector using the VLOOKUP function with its "range" option set to true.) SUMIF computes sums by group factor and COUNTIF counts by group factor. Their ratios are the bin means.
Here is what the formulas look like:
Only three formulas were actually entered and then copied down as needed:
=VLOOKUP(A2, Bins, 1, TRUE) computes the group for the value in cell A2. Bins a name for the array $(-2,-3, \ldots, 3)$ in column B.
=AVERAGE(B3:B4) computes the midpoint of the first bin. This was used as a horizontal plotting position in the scatterplot.
=SUMIF(Bin,"="&B3,NewValues)/COUNTIF(Bin, "="&B3) is where all the work is done. Bin refers to the group codes in column D and NewValues refers to the associated values in column C. The tricky parts are the constructs "="&B3: these form a text value instructing the data to be grouped by comparison to the number in cell B3, which is the first endpoint. Because this is a formula, copying it down automatically updates the B3 to B4, then B5, etc.

How to create a Range Chart in Excel

I have no idea how to create souch a range chart in Excel 2010:
rangechart http://i.msdn.microsoft.com/dynimg/IC267977.gif
My data looks like this:
1, 12, 22
2, 8, 48
3, 22, 42
...
The first column is the x-Value, the second column the lower y-value and the third the higher y-value. That's the yellow area in the graph.
And then the same for the blue one.
Thank you!
Source of the image: http://msdn.microsoft.com/en-us/library/dd456630.aspx
My recommendation would be as follows:
Paste the following into an Excel sheet
20% 20% 20% 20% 20%
10% 10% 10% 10% 10.0%
40% 10% -5% 10% 45.0%
20% 20% 20% 20% 20.0%
10% 40% 55% 40% 5%
Notice that the sum of each column is 100%
Now add a "stacked area" chart (under the area category of charts) based on this data, and colour the first and third and fifth colours to be white (or transparent)
You can then play with the percentages to get your chart. The top row which is 20% corresponds with a rectangle etc.
I would arrange my data in a Table as follows:
axis y_1 h_1 y_2 h_2
1 12 10 30 10
2 8 40 2 4
3 10 12 43 4
4 17 12 18 5
5 30 6 31 5
6 4 7 5 6
7 5 8 6 7
8 2 9 34 8
9 1 4 2 9
Then, you can chart the columns y_1, h_1 in the first axis and y_2, h_2 in the second axis (y_i being the y value and h_i being the height of each strip). Make both chart as Stacked Area chart and change the series y_i transparent.
Finally make the second axis equal to the first one.
What worked best for me using MS office 2010 is to use area chart, but not stacked. For multiple data ranges graphs in a single chart, I needed to arrange data legends (column names) from higher to lower, by clicking on the chart and then under "Chart Tools"->"Design" tab click "Select Data". A new window titled "Select Data Source" will pop up. Select data legends in the left pane in the window and move up or down using arrow button on top of the left pane such that graphs will stack from high to low. Now, we need to select graphs corresponding to lower end of the range and fill solid "white" by formatting the graph. What will be left is range chart with shaded area between low and high ends of the data. It seems bit complex, but doing a hand-on tutorial, following the above instructions step-by-step on a chart in excel or power point (after selecting insert chart option), will make it easy.

Resources