Google sheets bar chart with multiple variables - google-sheets

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")

Related

Hide future months with 0 values from chart in google sheets

I have a sheet that automatically pulls in order numbers every month, and a chart to show the trendline. I have formatted the future months because I want the chart to be automatically updated. But the value of the order numbers for future months in currently 0 and that messes with my chart. I want those to be hidden from my chart, so that the chart only runs to the last month.
Example sheet: https://docs.google.com/spreadsheets/d/11FOBKKfxY-usK5aGjrc8KpoiYeMgXrb3apzfYrpoaUg/edit?usp=sharing
added a solution in your sheet here:
you can filter the data first and use those columns as data source for the graph. the formula auto-updates until previous month stats. and also you can just hide those columns since you have the primary A,B columns in visibility.
=filter(A:B,EOMONTH(A:A,0)<=EOMONTH(TODAY(),-1))

auto ranking of rows when new data is added to sheet

I have a Google sheet (sheet A) that gets fed from another sheet (sheet B). I am trying to auto-rank the rows when new data gets added to sheet B. 
In the provided example screenshot (Example below), I use a formula for the "Points" column (M). All it does is if Column L has a value of 1 then assign 7 points, if the value is 2, then assign 5 points, and if the value is 3 then assign 3 points. All others get 1 point. So every new row is added - the points are automatically assigned.
={"Points";arrayformula(IF(L2:L="",,IF(L2:L=1,7,IF(L2:L=2,5,IF(L2:L=3,3,1)))))}
The Rank column (L) uses the formula =RANK(K2, K:K).
I want a similar formula similar to points formula that ranks each of the new rows based on the Points.
I tried this formula but it does not work -
={"Rankings";arrayformula(IF(K2:K="",,IF(K2:K>1,RANK(K2, K:K))))}
Any help is appreciated.
Example Screenshot
you can try this in Column L
={"Rank";BYROW(K2:K,LAMBDA(ax,IF(ax="",,RANK(ax,K2:K))))}

How add 20% to data synced to a different tab with QUERY with Google Sheets

I need to pull data from one google Sheets tab to another and add 20% to the relevant cells.
The formula I am currently using is =QUERY('Sheet 1'!G13:K1000) to get the data into the second tab.
Can someone provide the formula i would need to add a calculation *1.2 for 20% ?
Thanks
Try below query formula-
=QUERY(Sheet1!A2:C5,"Select A, C*1.2 Label A'Customer', C*1.2'20%'")

Google Sheet Sum Row: Count if above or below criteria

I am trying to create a summary row in a google sheet that tallies up how many cells met their criteria. These criterion are set in 2 columns to the left; Column C is the "Goal" column, which has the goal number. Column D is the "MinMax" column, which determines if that goal number is the min or max.
For example, if the Goal is 5 and the MinMax is Max, then the goal is 5 or less (5 being the maximum number allowed).
I already have successfully created conditional formatting for this sheet, which looks like the following:
=IF($D4="Min",E4>=$C4,E4<=$C4) | Turn cell green
I am struggling to find a way to use a similar calculation for the Summary row. I feel like I might need an array formula, but I'm not sure how to set it up.
If you want to count the values try:
=if(D2="Max",countif(E2:E,">="&C2),countif(E2:E,"<="&C2))
If you want to sum them useL
=if(D2="Max",sumif(E2:E,">="&C2),SUMIF(E2:E,"<="&C2))
I actually figured out a formula!!
=countif(ARRAYFORMULA(if($D$4:$D$19="Min",E$4:E$19>=$C$4:$C$‌​19,$C$4:$C$19>=E$4:E‌​$19)),true)-countif(‌​E4:E19,"N/A")
I had to go back into the data and change the blank cells to "N/A" to make it work, but it works!!

Search the entire sheet and return an array of cell reference

Hi I am new to Excel/Google Spreadsheet.
I have a problem that I want to search the entire sheet for a given string.
For example the table looks like
A B C D
1 foo 1 bar 2
2 bar 9 abc 3
3 foo 2 bar 4
LOOKUP/MATCH/VLOOKUP can only search one row or column, I need a formula to search for the whole sheet for 'bar', and return the array of all found cells, e.g. {$C$1, $A$2, $C$3}.
What's more (the ultimate goal) is to calculated the sum of the numbers next to the found cells, in this example, 2+9+4=15.
I hope this can be achieved without VBA so that I can use the formula in Google Spreadsheet as well.
For your example, in Excel:
=SUM(IF(A1:C3="foo",B1:D3,0)) entered as an array formula, with ctrl-shift-enter
In Google:
=ARRAYFORMULA(SUM(IF(A1:C3="foo",B1:D3,0)))
The ranges can be as large as you like. The important points are that the first range covers all of the values you want to look for text in, and that the second range is the same size but shifted one cell to the right.

Resources