Fill in name column based on which sheet is being imported - google-sheets

I have a Google sheet which imports tracking numbers from multiple other sheets and different information from each. I am able to do that part but is it possible to assign a name to each sheet being imported and have the name displayed in a cell on the row?
I hope this isn't super confusing, I am providing a sample document below. I am importing information from Tom and Brent sheets into Master Sheet. I would like column B of the master sheet to say which sheet the import is coming from. Any thoughts?
Master Sheet https://docs.google.com/spreadsheets/d/10YnvyaK_ODWZpVoYMMItOr6Dr9j2Gy--aJ3d4hegVi4/edit#gid=0
Tom Sheet
https://docs.google.com/spreadsheets/d/1wnxnhRkTiLtut7Ej9kE-NH6GrK0S3St5f3snsr4KR_I/edit#gid=0
Brent Sheet
https://docs.google.com/spreadsheets/d/1X5VNVWkjP7ELy2Vuj5uzuK9fB6l1U9Wh9W3ORDkcxA8/edit#gid=0

=ARRAYFORMULA(SPLIT({
QUERY(IMPORTRANGE("1wnxnhRkTiLtut7Ej9kE-NH6GrK0S3St5f3snsr4KR_I","Sheet1!A2:C"),
"select Col1 where Col2 like '%USPS%'")&"♦Tom";
QUERY(IMPORTRANGE("1X5VNVWkjP7ELy2Vuj5uzuK9fB6l1U9Wh9W3ORDkcxA8","Sheet1!A2:C"),
"select Col1 where Col2 like '%USPS%'")&"♦Brent"}, "♦"))

Related

Update certain cells from another Sheets according to a criteria in Google spreadsheets

I'm creating a Budget calculator spreadsheet in Google Drive, I'm trying to update cells from another Sheet with certain criteria:
This is Sheet1:
According to the date and category should update a cell from another Sheet in the same document, with the quantity.
This is Sheet2:
I'm not sure If I'm able to implement this flow in the same Google spreadsheets or if I should use Python instead. I tried everything and I'm stuck here. If someone could give me a hint about it I'll appreciate it a lot.
Here's the link to the spreadsheet: https://docs.google.com/spreadsheets/d/1BEtKJGVOdVF8PLxcR_96cPjE_4XH0QFbtV9dynroly0/edit?usp=sharing
try this cobra query in B13:
=INDEX(IFNA(VLOOKUP(A13:A21, QUERY({Sheet2!A3:D;
TO_DATE(SEQUENCE(12, 1, 2, 33)), 0/SEQUENCE(12, 3,,)},
"select Col2,sum(Col4)
where Col2 is not null
group by Col2
pivot month(Col1)-1"), SEQUENCE(1, 12, 2), )))

New Google sheet combining columns from multiple sheets with join based on common field

I've 3 or more Google sheets. Each sheet covers different aspects of employee info. These sheets would get new entries added every now and then. All the sheets have ID column.
The new sheet has UNION of all fields from different sheets joined by a common field present in every sheet, e.g. email id.
For example:
Source 1:
Source 2:
Expected new sheet with the integrated data joined by email id is:
Ideally, the integrated sheet should not have the repetition of join key, i.e. Email.
I want this integrated sheet to be automatically updated with new rows as and when new data comes in all the sheets. Ideally, this should happen when data in all the source sheets are complete for a given ID.
What is the best way to achieve this?
use arrays {} like:
=UNIQUE(QUERY({Sheet1!A2:B; Sheet2!A2:B; Sheet3!A2:B};
"where Col1 is not null"))
update 1:
=UNIQUE(QUERY({
IMPORTRANGE("url_of_spreadsheet_here"; "Sheet1!A2:B");
IMPORTRANGE("url_of_spreadsheet_here"; "Sheet2!A2:B");
IMPORTRANGE("url_of_spreadsheet_here"; "Sheet3!A2:B")};
"where Col1 is not null"))
side note: each importrange formula needs to be run as standalone to connect your sheets by allowing access - only then you can use above formula
update 2:
if columns are mixed you can "correct" them like:
=UNIQUE(QUERY({
QUERY(IMPORTRANGE("url_of_spreadsheet_here"; "Sheet1!A2:C"); "select Col1,Col2,Col3");
QUERY(IMPORTRANGE("url_of_spreadsheet_here"; "Sheet2!A2:C"); "select Col3,Col2,Col1");
QUERY(IMPORTRANGE("url_of_spreadsheet_here"; "Sheet3!A2:C"); "select Col2,Col3,Col1")};
"where Col1 is not null"))

Is there a way to link data by names in Google Sheets?

I am using Google Forms and Sheets to create a way of tracking services including time for some of our students. I have the forms linked to a Sheet and am able to pull the "Clock In" data and "Clock Out" data into a single sheet. My issue is: when I go to analyze using pivot tables it pulls the data from the cell of the next row (students do not necessarily clock in/out in the order they arrive). Is there a way I can link the data by name and then order by time?
Any help would be greatly appreciated!
Example Sheet
you can but not in one go because pivot tables are not so advanced. create a new sheet and paste this in A1 cell and then crate your pivot table from this sheet:
={QUERY({Combination!A1:E}, "where Col1 is not null order by Col3, toDate(Col1) , toDate(Col2)", 1),
QUERY({Combination!F1:I}, "where Col1 is not null order by Col3, toDate(Col1) desc, toDate(Col2) desc", 1)}

Combining all data into a new sheet

I have a spreadsheet with names of and four sheets of products.
I would like to combine all the information into a single sheet.
Here is a link to the test spreadsheet.
https://docs.google.com/spreadsheets/d/1cr6emubhqVnCdhuuOwPZEgK0t9e8k4JYWehSnYrx0uI/edit?usp=sharing
as you can see in the final sheet the outcome
Please try:
=query({Tea!A1:B10;Coffee!A2:B10;Water!A2:B10;Juice!A2:B10},"where Col1 is not NULL")

Query and import targeted data in seperate Google Spreadsheets

I'm trying to use Google Spreadsheets in conjunction with a Google form to 'collect' data, use the collected data to locate associated data in a source spreadsheet, and then import that targeted data into a separate target spreadsheet. I've done some research in Google Groups and 'think' I have the basic function, but I'm missing the 'if/then' portion and the syntax is off.
RED cell in 'target' will be used to locate the appropriate row in 'source'.
Green cell in 'target' will be used to locate the appropriate column in 'source'.
What I have so far...
=QUERY(importRange("[key]", "Sheet1!A1:C5"), "select Col1, Col2, Col3 where Col2='data1'", 1)
The "select Col1, Col2, Col3 where Col2='data1'", 1) portion of the function is the part I'm stuck on.
First, I want to locate a row in the source spreadsheet based on cell data in the target spreadsheet. For example, where Col2='B2'", 1)
Second, I want to pull specific data from the source spreadsheet based on a 'if statement'
For example, if col3=2nd then copy col4, col5 if col3=3rd then copy col6, col7. **I know this section is completely off.
Any suggestion?
Thanks everyone!
Todd
High School Teacher # Grossmont High School
=VLOOKUP($B2,Sheet2!$A$1:$G$7,MATCH("Teacher"&LEFT($C2,1),Sheet2!$A1:$G1,0)+COLUMN()-4,0) in D2 and copied into E2 of Target sheet seems to work in both Excel and Google Doc spreadsheet, though it is not a script.

Resources