Merging data from 3 pie charts into 1 pie chart - google-sheets

please help with this issue! I'm in desperate need. As you can see in the below link, I have 3 pie charts for October, November, December - how can I merge the info from these 3 charts to collate into 1 summary pie chart?
https://docs.google.com/spreadsheets/d/1_eSR50QFFzWiP1YK1vb_VCx4cpXgZPJ9p1PJqFh-XiE/edit#gid=0
HELP!!!!

Here you can find my answer
https://docs.google.com/spreadsheets/d/1U0sGonQrZkasDkGIR5NGPJkkMk7SDCYNAcoiaU_gv1s/copy
I see that pie charts use only top 5 of MOST used things.
To combine 3 months you need to sum all the data for all months and get TOP5 of the sum.
I use query function for this:
=query({B2:C6;F2:G6;J2:K6},"select Col1, sum(Col2) group by Col1 order by sum(Col2) desc limit 5 label sum(Col2) ''",0)
You need to repeat this for each top5 set.
Then you make a new pie chart based on combined data:

Related

Google sheets bar chart with multiple variables

I am trying to create a google sheets bar chart showing instances/count of categories/variables (A,B or C) per year.
I’ve managed to create the following:
A - chart showing count/instances of the variables. However, this is not divided by year.
B - showing total count of the variables per year. However, this is only showing total count, not the division/proportion of categories in this count.
But what I want to do is something more similar to this (preferrably the first one, showing division and total Count in the same bar)
chart example
Link to example sheet:
https://docs.google.com/spreadsheets/d/1aM1o3Qpqq18pfTtIl3DOu9vFD8u7ouNrX1G87UtLGs4/edit
Is this possible?
you will need to transform your dataset to:
=QUERY(A2:B, "select count(B) where B is not null group by B pivot A")

Multi-level nested pie chart in google sheets

I need a multi-level nested pie chart in google sheets.
To show number sums in categories and sub-categories. Can use code or just formulas.
Or if a system similar to google sheets already has a easy configurable nested pie-chart I can consider using it.
Here is a sample sheet with 2 charts I want to combine:
https://docs.google.com/spreadsheets/d/1TvOf_tRNFS4zqbYR8EMGfTH1krI_iX9resrQ_AwmGZ8/edit?usp=sharing
It can be similar to the one here, but with sums instead of counts:
Three Google Sheets' data graphs (pie charts) in one graph
Or a D3 Sunburst Partition.
dynamic fx:
=ARRAYFORMULA({TRANSPOSE(QUERY({A1:C}, "select sum(Col3),Col1 where Col1 is not null group by Col1 label sum(Col3)'Base Pie'"));
{"♀", IFERROR(1/(1/TRANSPOSE(MMULT(TRANSPOSE(IF(SEQUENCE(COUNTUNIQUE(A2:A))<SEQUENCE(1, COUNTUNIQUE(A2:A)),
QUERY({A2:C}, "select sum(Col3) where Col1 is not null group by Col1 label sum(Col3)''"), )*1), SEQUENCE(COUNTUNIQUE(A2:A), 1, 1, )))));
QUERY(QUERY({A2:C, ROW(A2:A)}, "select Col2,max(Col3) where Col3 is not null group by Col4,Col2 pivot Col1"), "offset 1", )};
{"♂", IFERROR(1/(1/TRANSPOSE(MMULT(TRANSPOSE(IF(SEQUENCE(COUNTUNIQUE(A2:A))>SEQUENCE(1, COUNTUNIQUE(A2:A)),
QUERY({A2:C}, "select sum(Col3) where Col1 is not null group by Col1 label sum(Col3)''"), )*1), SEQUENCE(COUNTUNIQUE(A2:A), 1, 1, )))))}})
the formula takes data in A:C range and creates all necessary steps, columns and rows that will feed pie charts.
rows labeled ♀♂ serve as pie chart ratio correctors
column E can be used as a subcategory labeling system if needed
in the same manner row 3 can be used as labels for base pie
first, we create a base pie chart (from the black row) which will serve as background:
next, for each colored column we create a separate pie chart that we overlay on top of the base pie chart. note that colors and sub-colors needs to be selected manually for each slice by double-clicking a given slice and selecting either color or none in the case of ♀♂ slices
and repeat for the next column...
demo spreadsheet
E2:
=QUERY({A2:C}, "select Col1,sum(Col3) where Col1 is not null group by Col1 label sum(Col3)''")
G2:
={FILTER(B2:C, A2:A=E2); "", SUM(FILTER(B2:C, A2:A<>E2))}
I2:
={"", SUM(FILTER(C2:C, A2:A=E2)); FILTER(B2:C, A2:A=E3); "", SUM(FILTER(B2:C, A2:A=E4))}
K2:
={"", SUM(FILTER(B2:C, A2:A<>E4)); FILTER(B2:C, A2:A=E4)}
demo sheet

dynamic range of columns as dimensions

I have a spreadsheet that looks something like this:
Harvest stats
2020-01. 2020-02. 2020-03. 2020-04.
Apples 2 3 3 4
Oranges 3 1 2 6
I would like to draw a timeline plot in datastudio with the dates in the X axis and #of fruits in the Y-axis? Is there any way to specify a range of columns as dimensions as opposed to manually adding them to the dimensions?
Your source is Google Sheets? Yes, then add another sheet and paste the values from the first one transposed.
Data Studio itself cannot pivot / unpivot data.

Google sheets conditional formatting of lowest n

I keep sheets with scores for players, and the 10 lowest scores are counting.
What I would like to do is to color the 10 first lowest scores in light green.
The last highest number of those 10 in darker green. (It's the score to beat in order to improve your total score) And the lowest score in yellow.
I guess it is easier to explain with an example:
https://docs.google.com/spreadsheets/d/1BSGfpzmaibsR4dxHqFgmYmJq7RtyAEV8uRCB0S3Fa4A/edit?usp=sharing
Feel free to copy your own set and try out:)
The solution was to get Rank without ties, and this would give you Rank without ties:
=RANK(B2,$B2:2,1)+COUNTIF($B2:B2,B2)-1
With correct rank it's easy to add custom formatting for the highest of the 10 lowest:
=RANK(B2,$B2:2,1)+COUNTIF($B2:B2,B2)-1=10
Since it works on a range, B2 in the formula will be substituted for each cell in the range.
So the problematic cell O4 will give:
RANK(O2,$B2:2,1) equals 10
COUNTIF($B2:O2,O2) equals 2
so
RANK(B2,$B2:2,1)+COUNTIF($B2:B2,B2)-1 equals 11 ie it will not be colored
Had to add an extra condition to color the highest scores for players with less than 10 scores.
The closest I can get quickly is with 3 rules:
1: Lowest:
=QUERY(QUERY(TRANSPOSE(B2:Q2),"SELECT Col1 ORDER BY Col1 DESC LIMIT 10"),"SELECT MIN(Col1) LABEL MIN(Col1) ''")
2: Highest:
=MAX(B2:Q2)
3: Then a between:
=QUERY(QUERY(TRANSPOSE(B2:Q2),"SELECT Col1 ORDER BY Col1 DESC LIMIT 10"),"SELECT MIN(Col1) LABEL MIN(Col1) ''")+1
&
=MAX(B2:Q2)-1

Three Google Sheets' data graphs (pie charts) in one graph

I have three google sheets of data in one spreadsheet. these sheets containing the data of ABC Town students. ABC Town has 3 Streets called Street 1, Street 2 and Street 3.
Street 1 has 10 Students in different grades.
Street 2 has 6 Students in different grades.
Street 3 has 2 Students in different grades.
Every sheet has Students Grade summary Pie Graph. Now What I need is,
I have to combine these three pie charts into one chart to get a final summary of three sheets. how can I do this? Please.
This is my spreadsheet: https://docs.google.com/spreadsheets/d/1NmCSRPaoGCpuyfxv24z2-M8TNktBjHNt7BoaMF6LCJY/edit?usp=sharing
explained in image:
or maybe you just want to combine all 3 charts (?) like:
demo spreadsheet
if you map out your data the right way you can create pie chart with sub-slices for each of your three pie charts and then you will just layer them. here is an example:
your dataset of A1:C is not in "good" shape for creating a chart, so first, you will need to re-shape it by adding few formulas in auxiliary columns which you can hide when done
in cell E1 paste this formula and create a base pie chart. this will create even ratio between Libaries. select primary color for each libary and maximze chart style
={"Libaries"\""; {TRANSPOSE(SPLIT(REPT(1&" ";
COUNTA(UNIQUE(FILTER(B2:B; B2:B<>""))));" "))\
UNIQUE(FILTER(B2:B; B2:B<>""))}}
if you got #ERROR! paste this into E1 cell:
={"Libaries",""; {TRANSPOSE(SPLIT(REPT(1&" ",
COUNTA(UNIQUE(FILTER(B2:B, B2:B<>""))))," ")),
UNIQUE(FILTER(B2:B, B2:B<>""))}}
paste this formula in G1 cell to create labels:
=ARRAYFORMULA(SPLIT(JOIN("×";
TRANSPOSE(REPT(UNIQUE(FILTER(B2:B&"×"; B2:B<>"")); 2))); "×"))
then paste this formula in G2 to create dataset for 2nd chart:
=ARRAYFORMULA(QUERY(TO_TEXT($A$2:$C);
"select count(Col3), Col3
where Col1 is not null and Col2='"&G1&"'
group by Col3
label count(Col3)''"; 0))
after this you will need correction formula which can correct position of the first set of pie slices. paste this in G6 cell and create 2nd pie chart from range G2:H. then play with colors and set color of the correction pie on None
=IF(SUM(ARRAYFORMULA(QUERY(TO_TEXT($A$2:$C);
"select count(Col3)
where Col1 is not null and Col2='"&G1&"'
group by Col3
label count(Col3)''"; 0)))>3;
SUM(ARRAYFORMULA(QUERY(TO_TEXT($A$2:$C);
"select Col3, count(Col3)
where Col1 is not null and Col2='"&G1&"'
group by Col3
label count(Col3)''"; 0)))*2; 6)
when done, overlay 1st chart with 2nd chart
then paste this formula in i4 cell (this will be dataset for 3rd chart)
=ARRAYFORMULA(QUERY(TO_TEXT($A$2:$C);
"select count(Col3), Col3
where Col1 is not null and Col2='"&I1&"'
group by Col3
label count(Col3)''"; 0))
next you need correction again. this time twice. paste this formula in i2 and i7
=SUM(ARRAYFORMULA(QUERY(TO_TEXT($A$2:$C),
"select Col3, count(Col3)
where Col1 is not null and Col2='"&I1&"'
group by Col3
label count(Col3)''", 0)))
now you can construct 3rd pie chart from range i2:J. again play with colors and hide correction slices. when done overlay it on top of 1st and 2nd chart
when done paste this formula in K4 cell (this will be dataset for the 4th pie chart)
=ARRAYFORMULA(QUERY(TO_TEXT($A$2:$C);
"select count(Col3), Col3
where Col1 is not null and Col2='"&K1&"'
group by Col3
label count(Col3)''"; 0))
and again you need to correct the position with this formula pasted in K2 cell
=IF(SUM(ARRAYFORMULA(QUERY(TO_TEXT($A$2:$C);
"select count(Col3)
where Col1 is not null and Col2='"&K1&"'
group by Col3
label count(Col3)''"; 0)))>3;
SUM(ARRAYFORMULA(QUERY(TO_TEXT($A$2:$C);
"select Col3, count(Col3)
where Col1 is not null and Col2='"&K1&"'
group by Col3
label count(Col3)''"; 0)))*2; 6)
create 4th pie chart from range K2:L, play with colors, hide correction slice, possition it on all previous charts
if you want to put up some labels then you can insert drawings and overlay it once again
demo spreadsheet

Resources