Is there a way to link data by names in Google Sheets? - 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)}

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

Extract Value from Cell on Another Sheet Based on List

I have a list of data on one sheet. A second sheet is used to display who's done what, like a dashboard. I've been given an array formula to generate the data that looks up the employee's name, and displays it if they are present on the list for a course completed. If so, a "yes" is listed on the dashboard under the corresponding course number. I cannot figure out what I need to change the REGEXREPLACE with to present the date column from the data list instead of "yes". I'm aware REGEXREPLACE only works for text values, and dates aren't - even changing the date column to text seems to matter not.
Here is a working example of the current array formula:
https://docs.google.com/spreadsheets/d/1jkG515zyl4UxRHxhtFTjgWsjG0aBE4vsOxbpvqgjogU/edit#gid=536376041
Here is the formula used:
=ARRAYFORMULA(IF(A5:A="",,REGEXREPLACE(IFNA(VLOOKUP(A5:A,
QUERY({TRIM('Form Responses 1'!B2:G)}, "select Col1,count(Col1) group by Col1 pivot Col6"), MATCH(F2:P2,
QUERY(QUERY({TRIM('Form Responses 1'!B2:G)}, "select Col1,count(Col1) group by Col1 pivot Col6"), "limit 0", 1), 0), 0))&"", "\d+", "yes")))
In the above example, I need the Date Completed from col D on the Form Responses sheet.
Here is a first attempt that might help you.
This is a straightforward query, that pulls the dates, and pivots to have the employee names on the left, and the course names on the top.
But it doesn't try to match up data with an existing list of employees - it just lists all of the employees that have submitted a form. So if you want to see all employees, with blank rows for those who haven't submitted a form, this won't work for you.
The formula, in A2,is:
=ARRAYFORMULA(QUERY({'Form Responses 1'!B2:G}, "select Col1,max(Col3) where Col1<>'' group by Col1 pivot Col6 order by Col1"))
See tab Sheet1-GK, added to your sample sheet.
Let me know if this helps, or if you need something different.
UPDATE:
To limit the result to a specific list of courses, use the following modification:
=ARRAYFORMULA(QUERY({'Form Responses 1'!B2:G},
"select Col1,max(Col3) where Col1<>''
and Col6 matches '" & TEXTJOIN("|",1,F2:2) & "'
group by Col1 pivot Col6 order by Col1 "))
Here, the list of desired courses to report on is in F2:2, where you had them originally, but this list could be kept anywhere, even on another tab. If you name the range where you place it, that can simplify this formula a bit. For now, you could just hide row 2. I've grouped it, on the left, to hide it. Use the [+] to reveal it again.

Fill in name column based on which sheet is being imported

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"}, "♦"))

Combining multiple Google sheets into single Google spreadsheet

I have multiple google sheets (45 of them, all dynamic, its content will keep on changing) and I want to combine data of all of them into a single file. I was hoping to use some importrange or QUERY function so that moment one / any file is updated, the changes reflect automatically on the combined sheet.
Example book 1 :
https://docs.google.com/spreadsheets/d/1sOkV9BT8ptndE0xcN2MUi4tTZ5p-aZxuLY_u29Y6nBI/edit?usp=sharing
Example book 2 :
https://docs.google.com/spreadsheets/d/1jZml9oVI2Flma407AB4ndl_ZIsQ_5I8zhkzvbL_EO_g/edit?usp=sharing
Example combined book :
https://docs.google.com/spreadsheets/d/1LkiIY1aUmwaouR7f4KhaGs6MV365KY7DYUPMiTzxjvc/edit?usp=sharing
first you need to connect them by pasting each IMPORTRANGE formula in some cell to get #REF! error
then hover over that #REF! error with your cursor and a secret magic button will popup
click on it to allow access
then you can stack up all import ranges and wrap them in a query:
=QUERY(
{IMPORTRANGE("ID1-or-URL1", "Sheet1!A1:A");
IMPORTRANGE("ID2-or-URL2", "Sheet1!A1:A");
IMPORTRANGE("ID3-or-URL3", "Sheet1!A1:A");
IMPORTRANGE("ID4-or-URL4", "Sheet1!A1:A")},
"where Col1 is not null"), 0)
update:
={ IMPORTRANGE("1sOkV9BT8ptndE0xcN2MUi4tTZ5p-aZxuLY_u29Y6nBI", "Sheet1!A1:N2");
QUERY({IMPORTRANGE("1sOkV9BT8ptndE0xcN2MUi4tTZ5p-aZxuLY_u29Y6nBI", "Sheet1!A3:N" );
IMPORTRANGE("19SFnJab9xVW2SenK-8IuG2cQRT2exJeyqARjTdDE_R8", "Sheet1!A3:N" )},
"where Col1 is not null", 0)}

Resources