I use spreadsheets to manage Google Ads campaigns. In first column I import campaign names using Query function:
=QUERY('data-campaigns-all'!A:H,"select B, count(A) where A > date '"&TEXT(DATEVALUE($S$1-14),"yyyy-mm-dd")&"' group by B order by B LABEL count(A) ''")
So I have a list of active campaigns for the day. I import other values (such as number of clicks, conversion values and so) based on campaign name, using sumifs or other formulas.
But I manually add a column with a budget for every single campaign. And it's just plain number. And when a new campaign pops up in the list, it adds a new row and whole dataset switch. All other metrics are tied up with campaign name, by some kind of formula (sumifs, vlookup and so) but budget (plain number) always stays at its place while other data shift.
So I want to tie up the first column (with campaign names) with budgets (which are added manually and are not in source data). The only solution that came up in my mind was to add a static sheet with campaign names and corresponding budget values and then add it to my final sheet using VLOOKUP, but I hope there's an easier solution.
Related
I have a google sheet that contains an inventory list that include manufacturer and model id's. Each line item contains a price and the amount the product is discounted below MSRP. I have the raw information dumping into a spreadsheet daily but I need the sheet to automatically sort the sheet by the make/model/highest discount value and then remove the duplicates (Removing all of the lower make/model/discount values). I could easily do this task manually but I am hoping to find a scaleable way to perform this tasks for many different lists.
To get UNIQUE Id's paste this formula in F2.
=UNIQUE(A2:A)
In G2 Paste this formula and drag down.
=IF(F2="",,SORTN(FILTER($B$2:$D,$A$2:$A=F2),1,,4,0,3,0))
Note: duplicates are highlighted in yellow and green
I'm using multiple Google Sheets to set up a logging system for the transfer of students between classrooms during a study period. A master spreadsheet (I call it Spreadsheet A) contains a record of all the students in the building and the teacher to whom they are assigned, and each teacher has their own separate spreadsheet (Spreadsheets B1, B2, etc.) tracking only the students assigned to them. There are more than 100, which is why I opted for separate spreadsheets rather than giving each teacher a tabbed page in Spreadsheet A.
Teachers can request that a specific student be sent to them for help by entering their name next to the student's name on the master list (Spreadsheet A). When this happens, the student's name is added to a list on the spreadsheet of the teacher making the request (so that's Spreadsheet B1). Separately, the student's regular homeroom teacher sees the student's name highlighted on their page (Spreadsheet B2), and sees which teacher made the request. Spreadsheet A feeds all the information to the various Spreadsheet Bs
This is all done and built. However, we want to include a time-tracking function, to make sure that students are moving in a timely fashion and not disappearing. Currently, the teacher receiving the student enters the time they showed up on Spreadsheet A, but this is cumbersome. The teachers want a way to enter arrival times on their own pages, and have it visible to the sending teacher & the administration.
So, I want the main Spreadsheet A to pull data from teachers' Spreadsheet Bs, look for students who have arrival times listed, and then copy those arrival times into a data column next to the students' names on the master list on Spreadsheet A. That will, in turn, propagate out to their homeroom teacher and administrator, so they can see who's coming and going, and how long it's taking them.
Oh, and there are nearly 2,000 students, so there's no way to put in a search string name by name. It has to be a blanket formula that says:
If there is data in column K (an arrival time) on Spreadsheet B1 (and all other B-series spreadsheets),
Then use the data in column H (the student's name),
Find a match on the master list on Spreadsheet A,
And copy that data from Spreadsheet B1 into column F (Arrival time test) on Spreadsheet A, next to the appropriate student, but
Do nothing if there is no data in column K.
Is this even possible?
Test demonstration page:
https://docs.google.com/spreadsheets/d/1F2HYmGv8Vfw9TDeAI2eNmv73jCD-lWcfhKZvWM8-r58/edit#gid=0
The pages for each teacher can be opened from the links in the second page tab.
So far, I've tried to compile all of the data from the existing teacher spreadsheets (B1, B2, etc.) into one list as a page on Spreadsheet A. I thought this would then make it easier to match the names and times, but it always throws an error message, no matter what formula variation I try.
=QUERY({Importrange("1y4GjGnUK9usYCNnSClYl2piFgMlbn07wWClrgZnl6Ms","’Teacher page’!H6:K");Importrange("1dNNZR0GvskBU2WG2N348EGFDbHN2aK9kWmxhoQNmn2M","’Teacher page’!H6:K")},"Select Col1, Col2, Col3, Col4 where Col1 is not null ")
This produces: "Unable to parse query string for Function QUERY parameter 2: NO_COLUMN: Col2"
=QUERY({IMPORTRANGE("1y4GjGnUK9usYCNnSClYl2piFgMlbn07wWClrgZnl6Ms","Teacher page!H6:K");IMPORTRANGE("1dNNZR0GvskBU2WG2N348EGFDbHN2aK9kWmxhoQNmn2M","Teacher page!H6:K");IMPORTRANGE("1buhv3AAi6apWIg_-uZv_BzDvyOEvpkxTmO5is-Yhxi4","Teacher page!H6:K");IMPORTRANGE("1b-kEed3zFcZIg3eldcT0x0JXgiwfWNUou_N0ntPsVEg","Teacher page!H6:K")})
This produces a result, but only from the first Spreadsheet B (B1) queried. It doesn't include the results from the other three sheets in the test version. I still have no idea how I'd merge the data from that data collection to the original master list.
What I want to happen is if a value on Sheet1 exists in Sheet2, I want them both to delete. Essentially, i want a list of cells that do not exist in both sheets. I have queried an array that combines two columns on different sheets. I am just stumped on how to delete both cells (automatically) if they exist twice.
For reference, the first sheet has a list of incoming product's serial numbers, The second sheets has a list of those same products that are now going out. I want an active list of what i have in-house.
Sheet one
Sheet two
Sheet three combining the both
This formula will work
=query({incoming!B:B, outgoing!C:C}, "select Col1 where Col1 <> Col2",0)
Assume we have an 'incoming' sheet for incoming products, and 'outgoing' sheet for outgoing products.
Assume we want to list on 'stock', all the stock that has come in, but has not gone out - in effect a list of the stock on hand.
The formula is entered anywhere in the "stock" sheet.
Layout of the "incoming" sheet
Layout of the "outgoing" sheet
Results in the "Stock" sheet
The query uses curly brackets to group together two arrays. This is described (albeit briefly, in Using arrays in Google Sheets.
The stock codes on the "incoming" sheet will include all products, regardless of whether they are outgoing, or they are still on hand. So we compare the codes in this array to the "outgoing" codes and apply the criterion of "where Col1 <> Col2". That is, where the code is in 'incoming" but not in "outgoing".
For my department I made a dynamic and flexible overview sheet for every teacher, showing his of hers tutored students.
In one overview sheet I have made several query's, that gather data form different sources (students and teachers in different years). The query's are in one column, because I want to generate a list per teacher.
But the output the query formula generate, can differ in length (= number of rows it takes = number of students), that's is why I have to allow for a fixed number of rows in the overview sheet. And that can lead to ugly blank rows in my list.
Is there a way to keep the flexibility (for every teacher has a different number of tutored students), but remove the blank rows?
If any sheet for every teacher has the same number of same columns, then your data is well-structured and you could make single query on them.
=query({Sheet1!A1:C;Sheet2!A2:C},"select * where Col1 <> ''")
Pay attention on some details:
query should take only one row with headers, use Sheet1!A1:C with headers and the others SheetName!A2:C
when query have source, that contains of multiple tables, use Col1, Col2, Col3... instead of column's letters A, B, C... It may be even more convenient. This rule also works, when data is imported from another file.
You can combine ranges using , for columns and ; for rows and by wrapping the ranges in {}. (You need to add the curlies after indicating you are concatenating ranges)
Assuming in Sheet1 you aggregate the data from Sheet2 and Sheet3you can use:
={QUERY(Sheet2!A2:B, "SELECT A, B WHERE A <> ''");
QUERY(Sheet3!A2:B, "SELECT A, B WHERE A <> ''")}
Where A is the student names (or whatever cannot be empty) and B something arbitrary like marks. Of course that query can be as complex as you want (probably best to prebuild it and reuse it via reference then).
Objective: import filtered data from “Sheet2” into “Sheet1.”
Data is filtered in “Sheet2”, an expense table with dollar amounts in column A, and categories such as “fuel”, “meals”, “parking”, etc. in column B.
I understand that one way to do it is to make a separate sheet for each category and SUM those amounts, and import them into “Sheet1”. I am able to do that, however, I would like to use one sheet and some method to do the following:
In “Sheet2” filter the data for a determined category and display a SUM for that category in a predetermined cell in “Sheet1”.
I have shared the sheets here.
If I am shown how to do this for one category I will be able to copy and paste the function into the appropriate cells in “Sheet1” for the remaining categories.
I am aware that I may not be asking this in the best way. Thanks for all your help.
~ Joe D
=sumif(Sheet2!B:B,"fuel",Sheet2!A:A)
The above formula works for fuel, simply change "fuel" to whatever you are trying to sum.
If you wanted to change what was in Sheet1, cell A1 to fuel instead of fuel total and changed all the other values in column A to match. Removing total (remembering to remove the space too)
You could then use this formula in cell B1, drag it down, and as new expenses were added. It would look at the name of the expense and sum it.
=sumif(Sheet2!B:B,A1,Sheet2!A:A)
If you didn't want to take out the total then the following formula should work if placed in B1 and dragged down.
=sumif(Sheet2!B:B,SUBSTITUTE(A1," total",""),Sheet2!A:A)