More complex charting in Google Spreadsheet - google-sheets

I've got data that looks something like this:
Campaign Date Clicks
EmailA 14/08/01 20
EmailB 14/08/01 10
EmailC 14/08/01 5
EmailA 14/08/02 15
EmailB 14/08/02 7
EmailC 14/08/02 3
EmailA 14/08/03 10
EmailB 14/08/03 5
EmailC 14/08/03 1
I'd like to be able to set up a Google Spreadsheet chart to draw a line for each campaign, with the clicks charted out over time.
However, I've got to do this with lots of data, so manually adjusting the data (besides changing sorting) isn't really an option. And I don't want to have to manually define data ranges.
Is this possible? I know Google Spreadsheets isn't as complex as Excel, but I'm hoping this is doable.
Thanks for your help!

You can create a new table using QUERY (this will dynamically update as the source data changes):
=QUERY(A:C,"select B, sum(C) where B is not null group by B pivot A",1)
This pivots the data on the campaigns, and should facilitate charting the three series.

Related

Google sheets sum of arrayformula

I want to use arrayformula or filter like with the result of a list of numbers. My question is how to place at the bottom a total of the preceding numbers. The challenge is this is dynamically sized. So when I try to include an option to sum the numbers it doesn't work.
What complicates this even further I would then want to include some numbers below this that aren't included in the sum.
What I tried was this:
={"title"; ArrayFormula; sum of previous cells}
Projects
Title
P1
1
P2
2
P3
1
P4
2
Total
6
Edit: An example that I've used that didn't work out is this:
={arrayformula(if(filter($A2:$A,$A2:A<>"",$A2:$A<>"Total Sum",$A2:$A<>"(to be hired)")="","",{countifs('org 1'!$F$2:$F$1000),"="&filter($A2:$A,$A2:$A<>""),'org 1'!$A$2:$A$1000"),"<>(to be hired)")}));"Total hired"}
Edit:
Here's an example link:
https://docs.google.com/spreadsheets/d/1iBkX1B53vYQVUJ6j8dNOE_ck1dONidsqyNuO0lgSKHw/edit?usp=sharing
I'm using multiple tabs as a reflection to what I'm working with. The tab everything's suppose to show is the Indirect example tab.
I'm using the Source tab as a reference for the tabs I'm targeting. The data tabs is the place I'm drawing the info from.
I'm thinking that I won't be able to do this with ArrayFormula. Probably with Query instead. Not sure what it would look like. If ArrayFormula won't work then a query example would be nice.
see:
={"title"; FILTER(A:A, A:A<>""); SUM(A:A)}
={QUERY({A1:B}, "where Col1 is not null label Col2'title'"); "Total:", SUM(B:B)}

Combine data from multiple tables using indirect references in Google sheets

I am needing to combine all student attendance in one chart. I have tried Query, Vlookup, and Index Match - nothing seems to get the results I want. I need something to search first and last name and return all attendance from all sheets. I would like to use something like CHOOSE and INDIRECT due to the future size of this sheet.
Here is what I have tried:
=ArrayFormula(VLOOKUP(K2&L2,CHOOSE({1,2},{Indirect(E2) & INDIRECT(F2), Indirect(D2)},{1,2})))
=query(Arrayformula({INDIRECT(D2), Vlookup($K$2:$K$45 & $L$2:$L$45, {Indirect(E2) & INDIRECT(F2), Indirect(D2)}, false)}),"select Col1,Col2,Col3,Col10,Col17,Col24,Col31 where not Col1 is null",1
=ArrayFormula((VLOOKUP(K2,INDIRECT($D$3),{1,2,3,10,17,24,31})))
This is a very small example of what the final sheet will be. I included what I want the results to be on a separate tab.
https://docs.google.com/spreadsheets/d/1-XNePmTzVIc84ScasZxh1KlzTBxDyI_glxwg24uXGuI/edit#gid=868379110

Query particular row + remove X columns + and sum the rest in one formula?

I have a CSV file that I'm pulling from a database. It's in an awkward layout so I need to reorganise it and display the result in a separate sheet.
Here is a dummy example of the data structure I get.
https://docs.google.com/spreadsheets/d/1sTfjr-rd0vMIeb3qgBaq9SC8felJ1Pb4Vk_fMNXQKQg/edit?usp=sharing
It looks like that. The database grows every day by date and sometimes countries so I need to account to that in my formula.
I need to pull data per each country and display it by date.
I don't need data from Column A, C and D. And when there are multiple states I need to sum them up in one column.
It should look like this and keep growing downwards. I'm gonna use this table for a graph chart
What I've tried so far
=TRANSPOSE(QUERY(IMPORTRANGE("url_to_a_separate_sheet_where_I_importing_a_row_csv_file", "CSV-source-sheet!A1:500"), "SELECT * WHERE Col2='Germany'"))
This works, kinda. But pulls in unnecessary columns and I can't figure out how to sum countries with multiple states. When I add select sum(*) it gives me a big and long error. I assume it might be because of unnecessary columns that the formula cant sum up and I don't know how to omit them. I'm stuck
I tried offset and skipping no luck. Any ideas?
try:
=ARRAYFORMULA(TRANSPOSE(QUERY({Sheet2!B:B, Sheet2!E:BE},
"select Col1,"&TEXTJOIN(",", 1,
"sum(Col"&ROW(INDIRECT("Sheet2!A2:A"&COUNTA(Sheet2!1:1)-5))&")")&"
where Col1 is not null
group by Col1
label Col1'Date'", 1)))
spreadsheet demo

Fetch Row of Value From Other Spreadsheet Google Sheets

I would like to access data from one Google Spreadsheet on another using strictly formulas.
Currently, I am able to import data using the =IMPORTRANGE(), but need to take this a couple steps further.
The data that I have looks like this:
Spreadsheet 1: Each sheet is for a different day, and has people and the number of fruits they pick from a farm (this is example data). However, the people are not necessarily organized exactly the same way on each day.
Spreadsheet 2: Each sheet is organized by person. Row A has the day (which will be used to lookup from the other spreadsheet), and a function exists in the second spreadsheet to find the persons name (=sheetName()).
What I have so far is [for Spreadsheet 2]:
=IMPORTRANGE(Master!A1, A2 & "!B2")
Where Master!A1 refers to the link of the other spreadsheet, A2 refers to the Day1. However, the part I am looking to replace is the 2 in the B2 to find the row of the person's name in the sheet Day1 from the first spreadsheet.
I feel like I have to do something like this:
=IMPORTRANGE(Master!A1, A2 & "!B" & MATCH(IMPORTRANGE(Master!A1,A2 & "!B1:B100"),sheetName(),0))
, but this gives me the error that it "Did not find value 'Apples' in match evaluation"
Here is the example folder with the two spreadsheets.
https://drive.google.com/drive/folders/0B8lJN2vmKeTBV1JYR2ZoZlVfQUU
All help is appreciated!
I can't find the sample data that you attached but here's what you need to do.
1. Link of the other spreadsheet
2. Name of the sheet to import from
3. =importrange(link,sheet!A:D) [for the sake of an example]
4. =query(importrange(link, sheet!A:D),"select * where Col1 = 'Person's_Name' ",1)
Share a sheet if you are not able to put it together on your data. Cheers!!

Data handling Google Sheets and charts

I got a Google Form that are pushing data into my Google Spreadsheet. It's very simple and consist of 3 cols named:
A -> Date
B -> Type
C -> Data
There is three different types, which all have same data but different values (3 types data per day). I want to use these data in a bar chart, where X is the date represented per day basis, and the Y axis is the data value. But the series should be based on type, which in the end should lead to three bars per day.
This is probably fairly simple, but since I'm quiet new to G-Sheets, I have no clue of what to look for.
Dataset looks like the following example:
04-06-2016 house 140
04-06-2016 car 185049
04-06-2016 rental 14267
etc....
Please, look at my Bar Chart Sample.
The result looks like this:
Suppose, Data is stored in range A:C. I suggest select free cell (E1) and paste there the formula:
=QUERY({A:C},"select Col1, sum(Col3) where Col2 <> '' group by Col1 pivot Col2")
It will convert Data, pivot it. Then select range wich you got with formula (E1:H8) and paste new chart, select bar type.

Resources