Google Sheets sum multiple columns - google-sheets

I’ve just inherited a google sheet from a client where they’ve put multiple campaign performance data tables next to each other in a single sheet. I need to sum up the metrics into another sheet. The problem is that there are around 107 campaigns currently active and if I start summing them up the regular way with something like =sum(A2,D2,G2,etc) it’ll take me a long time to get it done AND there would be no guarantee of accuracy.
I’ve made some sample data which looks like my client data. Link to sample data: https://docs.google.com/spreadsheets/d/1DtcYbkdHgcOH-IzEaD4UsWT2upujx8qD4AC8LErlM-U/edit?usp=sharing
In the data tab, I have a sample of the campaign data. You can see that there are multiple sections where each section represents a campaign. In the consolidated sheet, I’ve shown the end result that I need to work towards - a daily summary of all campaign data.
I need a solution which will scale up to 107 campaigns whose data is recorded in this one single sheet in a similar format. I appreciate any help that I can get with this project!

You can use the Query formula to get the desired output:
=QUERY(ARRAYFORMULA({Data!B4:F6;Data!H4:L6;Data!N4:R6}), "SELECT Col1, Sum(Col2), Sum(Col3), Sum(Col4) GROUP BY Col1 ")
I have only added 3 tables as example, you can add more as required

Related

Google Sheets - Grab data from a separate sheet and add it to a master sheet

I have a Google Sheet that has a main master sheet, with a column for users to fill in their Name to show they are "working" on that row, then that row gets populated to their own tab based on a =QUERY(Master!A3:AA,"select * Where L='Name'") for each of the users' tabs, there is 8 total tabs where users are updating information. This is already quite a bit of processing on Googles part, so I am trying to generate a separate Google Sheet that pulls in the information that the users are entering on each of their tabs so the management can monitor that sheet for updates and then both sheets will run a lot faster/smoother.
I have tried using a VLookup with this syntax: =vlookup(A3,importrange("sheetID",{"Name1!$A$3:$N";"Name2!$A$3:$N";"Name3!$A$3:$N";"Name4!$A$3:$N";"Name5!$A$3:$N";"Name6!$A$3:$N";"Name7!$A$3:$N";"Name8!$A$3:$N"}),12,FALSE) which gives me an #N/A Error, cannot find Value '1' in VLOOKUP evaluation.
I have also tried using a =QUERY({importrange("sheetID"x8 with the ranges)}, "Select Col12,Col13,Col14 where Col2 matches '^.\*($" &B3 & ").\*$'")
That only returns headers, I am trying to get the query to basically find the unique key in Column A then spit out what is in Col 12-14, but that doesn't seem to work either. Columns 1-11 are static, but Columns 12-14 are what I am trying to populate for the management, which is the work that the staff is inputting on each of their tabs.
I can get the query working if I keep it on the same worksheet as the one the staff is working on, but then it bogs down the whole sheet so I would like to keep it separate if possible. Any ideas? I can't provide a sample sheet at this time since it has financial info on it, but I can add more details if I know what to look for.
your formula should be:
=VLOOKUP(A3, {
IMPORTRANGE("sheetID1", "Name1!A3:N");
IMPORTRANGE("sheetID2", "Name2!A3:N");
IMPORTRANGE("sheetID3", "Name3!A3:N");
IMPORTRANGE("sheetID4", "Name4!A3:N");
IMPORTRANGE("sheetID5", "Name5!A3:N");
IMPORTRANGE("sheetID6", "Name6!A3:N");
IMPORTRANGE("sheetID7", "Name7!A3:N");
IMPORTRANGE("sheetID8", "Name8!A3:N")}, 12, 0)
keep in mind that every importrange needs to be run as a standalone formula where you connect your sheets by allowing access. only then you can use the above formula

How to use importhtml in Google Sheets to import tables from multiple URLS coninuously in same spreadsheet?

URL1, URL2, URL3 all contain one table each.
I am currently importing each in different sheets.
Is there anyway to import them continuously in the same spreadsheet?
Update1: The number of rows in tables vary everyday, so I have to do it manually. I would like to know if there is a way to combine two importhtml functions with query or concat?
Something like =importhtml (url1, table,2) & importhtml (url2, table,2)
Update2: I have attached sample file link here
https://docs.google.com/spreadsheets/d/1VdFMzRTwcaFAglGNpqvzGytdz_mqohtxGgAywKlLi0U/edit?usp=sharing
In A1 there's one table and in I1 there is another.
This is stock market data so it changes everyday. I would like to know if there is a way to combine the formulas?
EDIT
(following OP's request)
This worked perfectly. Is there anyway to loose the header row of the second table...
Please inclose the IMPORTHTML functions in a QUERY
={QUERY(IMPORTHTML("xxx","table",1), "where Col1 is not null",1);
QUERY(IMPORTHTML("yyy","table",1), "where Col1 is not null offset 1",0)}
Please notice that in the second QUERY we use offset 1",0.
This will eliminate the headers of the second table.
PRO TIP
Since you now have everything in queries, you can also take advantage of all the many, so very flexible query properties/clauses like select, order by, group-by etc.
I am currently importing each in different sheets, is there anyway to import them continuously in the same spreadsheet?
Most likely yes. It highly depends on the formulas you use and the structure of the tables.
If they all have the same amount of columns you can probably create an array like
={IMPORTHTML("xxx","table",1);
IMPORTHTML("yyy","table",1)}
IMPORTHTML("zzzz","table",1)}
The above formula will stack the tables one on top of the other.
(hard to give a definite answer without further info and expected results)

Google Sheets: Join two tables together

Link to sample sheet - https://docs.google.com/spreadsheets/d/1nKQXHwVO8KjsOy5qvjzh-s-YYRUYlAoH-3aXYbwcKsA/edit?usp=sharing
I have a report that's downloaded from the google ads console which looks like this:
I get a report from the client which attributes leads to google ads campaigns like this:
I want to combine both these tables together to make them look like this:
If you look at the data in the first to tables, you'll see that the report the client shares with me has leads attributed to 24th March. This date is not present in the report that I got out of the google ads console. Using a sumifs formula will not capture all the leads that I get from the client's report.
Essentially, to get the data from both tables in the output table, I need to do a full outer join.
I'm not sure how to do that in google sheets. Any help you can give me would be greatly appreciated!
I made a new tab in your sample called MK.Help.
I then put this formula in cell L3:
=ARRAYFORMULA(QUERY({A3:G;{H4:I,IFERROR(ROW(H4:H)/{0,0,0,0}),J4:J}},"select Col1,Col2,SUM(Col3),SUM(Col4),SUM(Col5),SUM(Col6),SUM(Col7) where Col1 is not null group by Col1,Col2 label SUM(Col3)'Impressions',SUM(Col4)'Clicks',SUM(Col5)'Cost',SUM(Col6)'Leads',SUM(Col7)'Offline Leads'"))
That do what you're hoping?

How to pull data into separate tab based on two criteria from data added through Google Form responses

I am compiling quiz scores gathered from Google Forms on separate tabs to one tab called Scores. It needs to pull the data based on the email addresses gathered along with if the user scored 100%. The current formula I am using now is listed below, but I'm having difficulty adding the second piece of criteria to only pull instances where the score is 100%.
=Query(IMPORTRANGE("https://docs.google.com/spreadsheets/...","sheetName!A2:D100"),"select Col4 where Col2='email1#email1.com'")
try like this:
=QUERY(IMPORTRANGE("ID", "SheetName!A2:D100"),
"select Col4
where Col2='email1#email1.com'
and Col3="&100, 0)
or 100% or 0.01 - depends on what formatting you use

How can I keep command line fetch of google sheet from filtering?

I published 1 sheet of a multi-sheet spreadsheet.
I then fetched it with:
curl 'https://docs.google.com/spreadsheets/d/e/2PACX-1vS3iBtVf4i_won5zAN9NGPqhcd6CcTb-4QHxpisSjCmlgV95B6mFmZvtMaC9GPvD7m8kD-6XLkVAhfc/pub?gid=911257845&single=true&output=csv' >lib/Inventory/Inventory.csv
The source is a pivot table. If I have a filter engaged on the pivot table, the fetch brings in only what passes through the filter.
I can work around this by duplicating the sheet, and never filtering it, but this spread sheet is messy enough with 23 sheets. Is there a tweak for the url to not filter? Pointers to the tweak, and to the documentation appreciated.

Resources