Graph grouping by and percentages - excel

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:

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?

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

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)

Getting unique values in excel from table with multiple equivalent values

I am not an excel expert, but I have been searching for days on a method to repeatably pull non-zero entries from a 2 column table. The reason it has to be repeatable (and hence can't use filtering) is that I have about 50 pie charts with different data sets I need to create so that the charts only have slices that are greater than zero.
Here is an example of the source data, which I have pulled from a few thousand rows of raw entries
| Possession type observed | Count |
| ------------------------------|--------
|Handheld device 27
|Backback 53
|Baby stroller 5
|Walking aid 1
|Headphones 5
|Wheelchair or mobility device 2
|umbrella 1
|Bundle buggy 0
|book 0
|DVD 1
|purse & holding keys 0
|handbag 1
|clutch wallet 0
|white paper 0
|grocery bag 0
|purse 0
|holding newspaper 0
|None of these 83
I haven't found a satisfactory solution to build a pie chart out of the data above that removes zeros, so I went ahead and tried to create a summary chart only listing values > zero.
But my problem is that I can pull non-zero entries out, when it comes to the entries with the same value (e.g baby stroller and headphones both have a value of 5), I can't grab baby stroller, then headphones.
Ideally I would like the summary chart to look like this:
| Possession type observed | Count |
| ------------------------------|--------
|Handheld device 27
|Backback 53
|Baby stroller 5
|Walking aid 1
|Headphones 5
|Wheelchair or mobility device 2
|umbrella 1
|DVD 1
|handbag 1
|None of these 83
Thanks so much in advance for any assistance!
To get the desired output follow these steps:
Step1: Select the data
Step2: Choose pivot chart from insert tab,follow the wizard to create the pivot table and chart where you want them or hit Alt + D + P and 3 times enter
Step3: Change the chart type to pie from the Design tab
Step4: Drag the 'Possession type observed' field to the 'Axis' area
Step5: Drag the 'Count' field to the 'value' area as well as 'report filter' area
Step6: Filter out 0 using the dropdown on the chart

I want to get the sum of count of each unique entry from a particular column from google sheet

I have a google spread sheet,I want to get the sum of count of each unique entry from a particular column('Text' in this example).However the entries in the column themselves repeat.
Eg:
Text Count
a 3
b 4
a 8
abd 4
c 1
t 2
abd 5
a 2
v 1
v 67
w 44
I want the output as:
Text Count
a 13
b 4
abd 9
c 1
t 2
v 68
w 44
Under the assumption that you want to get the results in the text column automatically, use a Pivot table in Excel:
Mark your data including the column captions "Text" and "Count"
Go to the "Insert" tab in the ribbon, hit the arrow below and choose "PivotChart and PivotTable"
The cells for the raw data should already be entered. In the lower part of the window choose where you want to get the Pivot table. Then hit Ok.
There should be an area on the right-hand side of the window where you can choose which data you want to evaluate. Choose Text and Count.
There should already be the sum of the Count values. If you want to get a different quantity such as the average, hit "Sum of Count" with the right mouse button and
You need a GROUP BY and a SUM:
SELECT text, sum(count) as count
FROM yourtable
GROUP BY text

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.

Resources