I'm trying to count the instances of which the items have been added to each cell.
Please refer the screenshot.
I need to Count how many:
SIGMA CANON LENS
SIGMA NIKON LENS
SIGMA SONY LENS
are there in the column. Please help me on ow to get this done
try:
=INDEX(QUERY(FLATTEN(SPLIT(TEXTJOIN(CHAR(10), 1, A2:A), CHAR(10))),
"select Col1,count(Col1) group by Col1 label count(Col1)''"))
Related
I'm looking to flip a table and can't seem to make it work with a combination of array formula and transpose. I'm looking for a formulae that can do this for larger data set
Please see the picture below for details.
enter image description here
Tried array formulas, transpose, pivot table but with no success
use:
=ARRAYFORMULA(QUERY(SPLIT(FLATTEN(A1:C1&"×"&A2:C10); "×");
"where Col2 is not null"; ))
I understand that for COUNTIFS, you need to have ranges that are the same size and shape. However, I need one condition to be that the ID# in the cell matches the ID # in a one column range AND that the age in the cell matches the age value in a five column range. How can I work around this?
Sample sheet: https://docs.google.com/spreadsheets/d/1i6qFmJ1t7yDpGVSO8YOPnWqW_OZEz6fv4shTOBO-q3M/edit?usp=sharing
In cell A7 of the 'Analysis' tab I entered
=query(ArrayFormula(regexreplace(split(flatten(Masterfile!A2:A&"_"&Masterfile!B2:F), "_")&"", "\d+\smonths", "0")), "Select Col1, count(Col1) where Col2 <>'' group by Col1 pivot Col2")
See if that works for you?
I have a table for employees and dates, I want to find out how many cases they solved on an exact date. I tried using a query but it's not working for me as its a new challenge for me to make a query that works based on the horizontal and vertical values. here is an example:
https://docs.google.com/spreadsheets/d/19x2jGYM7xt_WIZN_OGPwTe_7q26Jj57l9Z0PUmSv0I8/edit#gid=0
try:
=QUERY(TRANSPOSE(QUERY(TRANSPOSE(A1:H),
"where Col1 matches 'Day|"&I3&"'", 0)),
"select sum(Col2)
where Col1 ="&DATEVALUE(I2)&"
label sum(Col2)''")
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
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