Google Sheets Pivot table disappearing when entering new data - google-sheets

I created a pivot table in Google Sheets that pulls student enrollment and attendance information from a report that we download from the state reporting system. I run this report multiple times a year to look at a variety of information. The columns always stay the same, but the rows/cell values change each time I run the report. When I paste the data over the data that I used last time, the pivot table goes blank. There is no easy way to identify what data has changed and the report contains thousands of rows of data. I tried re-selecting the pivot table data range, but the pivot table is still showing as blank. Is there a way to update the data without having to rebuild the pivot table in Google Sheets? I can't share the sheet I am working with since it contains confidential information.

Related

How to show employees who were absent (did not clock in) in Google Sheets with Google Form data?

I made a Google Form for employees to use to clock in and out each day. The data is going to a Google Sheet, which is turned into a pivot table and all is well except for how to view which employees did not clock in on a specific day. Ideally, I want a list of absent employees per day/employees who did not clock in/out on a certain day.
The Google Form has employees select their name from a drop down menu and select clock in or clock out. The data goes to a Google Sheet, which I have made a data processed tab from, to make a pivot table from. The list of absent employees does not need to be within pivot table, it can be a seperate tab. If it is possible to have absent employees listed somehow in the pivot table, that's great. Not a big deal if not.
Right now, I am manually going in and selecting employees who clocked in/out on a particular date, adding that to its own column, and comparing that column with the master employee list. Is there an automated way to do this? I am familiar with comparing two columns, but can't figure out how to sort employees based on the date they clocked in/out into one column to then compare it to another one (unless I manually create column at end of work day). Thank you!!
https://drive.google.com/file/d/1v5ssyIaW0fUdIBTKTr6FNZIzV1WNilqN/view?usp=sharing This is the raw data from Google From
https://drive.google.com/file/d/1axWe_nPSTvIPM2RvIz7AQZE_NSJmIEdQ/view?usp=sharing This is processed data which fills pivot table
https://drive.google.com/file/d/13rBxzJ5RtnYc-vo3RzocMrSwtMy9kbaB/view?usp=sharing This is pivot table

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 can I have multiple pivot tables in same sheet?

I have a big sheet with quite a lot of info that keeps growing over time. Based on that, I have created several pivot tables that do some calculations and rankings.
Every ranking keeps growing, so pivot tables may contain 10 rows now, but can grow up to 20 or 30 rows.
I managed to insert several pivot tables in the same sheet and now it looks well, with every ranking after the next one. However, if I add multiple rows, the pivot tables grow and start overlapping, so after a while the ones below start disappearing in favour of the first ones.
Is there a way to have multiple pivot tables in the same sheet with a fixed number of rows among them, preventing them from overlapping?
If you want to 'play' with the data, I created a sample in https://docs.google.com/spreadsheets/d/1MVX3tp6GIqVX6hTyk6TsCxV7YngiMpi7E8oSxa7a9ck/edit?usp=sharing. It is just a ranking on races, where I want to track the best times on different legs. Then it has a second sheet 'rankings' in which I have different pivot tables, one for each leg.
HOw's this for a single formula solution that will scale infinitely in users or legs:
=ARRAYFORMULA(QUERY(SPLIT(FLATTEN(results!A2:A&"|Best of "&results!D1:1&"|"&OFFSET(results!D2,,,ROWS(results!D2:D),COLUMNS(results!D1:1))),"|",0,0),"Select Col2,Col1,MIN(Col3) where Col1<>'' and Col2<>'Best of ' group by Col1,Col2 order by Col2, MIN(Col3) label MIN(Col3)'Best', Col1'User',Col2''"))
You'll find it in cell B1 on the new tab in your sample called MK.Idea
I should mention that FLATTEN() is an undocumented function that I only recently discovered. I've believe it is intended to remain "hidden" in the back end of the sheets programming, but if what I did is what you're after, there really isn't a more efficient way to do it. I've spoken with an engineer at Google who was surprised it existed as well and told me there were no plans to deprecate it, so here's hoping! For a demo of what it does generally, you can see my sample here:
https://docs.google.com/spreadsheets/d/196NDPUZ-p2sPiiiYlYsJeHD6F_eJq7CWO_hP7rFqGpc/edit?usp=sharing
Spreadsheets and Pivot Tables are marvelous tools for data analysis but they aren't too friendly for creating reports and dashboards, if you are open, to recommendations try Google Data Studio (it includes pivot tables too --> https://support.google.com/datastudio/answer/7516660?hl=en)
Let say that you don't have time to learn another app or you just prefer to keep using spreadsheets, in this case it will be required to implement a workaround.
First, bear in mind that Pivot Tables don't actually overlap, instead an error message is shown:
Solution: insert some rows/columns to give enough room to the Pivot Table to be expanded.
NOTE: You could do this in advance by including a "safe zone" (meaning blank rows /columns) around the pivot tables. You could hide/unhide this "safe zone" as needed.
If you don't want to do the above manually, I think that it should be possible to use an on edit trigger of Google Apps Script to detect that pivot tables are shown and insert new rows/columns to avoid this. If the Pivot Table top left cell returns #REF! your script could use a do.. while or a while to insert the required rows or columns. An smart algorithm will read the Pivot Table settings to calculate the required rows and columns and then insert the required rows / columns in one pass.
Related
Pivot table with Google Script

Google Sheets - linking two separate sheets and importing values

I have two spreadsheets:
A budget sheet, with estimated costs and actual costs. Replicated here: https://docs.google.com/spreadsheets/d/1J8wPicVyfs98QXRXRCHZoq-Y6Uoi75Iv8WitGja4Pic/edit#gid=0
A cost tracking sheet, with the actual costs and reference to receipts. Replicated here: https://docs.google.com/spreadsheets/d/1YclB3V3817Q-RGwuzrOXoZkarwFszaTqwUFurtYtLVo/edit#gid=0
Currently I am importing the 'actual costs' in the budget sheet, by referencing rows from the 'actual costs' in the tracking sheet
So my budget sheet references the cost tracking sheet this way:
=(importrange("spreadsheet_key","sheet_name!I76"))
This works fine, however, if I insert a new row into my cost tracking sheet above some of the values I am already referencing, it will not dynamically update.
So if I insert a new row above:
=(importrange("spreadsheet_key","sheet_name!I76"))
I then have to manually change it in the other sheet too for each item:
=(importrange("spreadsheet_key","sheet_name!I77"))
Is anyone aware of a way I can link two sheets and still be able to insert rows without this breaking?
Thanks
Sounds like you want a sheet that updates when new values are entered into a separate sheet? I think a short script similar to the one proposed in this question should work for you.
Detect user inserting row or column in a google spreadsheet and reacting in a script

Google Sheets Copy Down Issue

I have a google form that my students fill out daily. All form responses feed into one workbook. From the workbook, I have a spreadsheet for "Clean" data. Which is just the information from the responses sheet needed to graph progress. The formula I am using in A2 is: ='Form Responses 1'!N2
Nothing too complicated right?
However, each day that I want to show the kids their progress on the charts, I have to select the last two entries in the Clean Data worksheet and copydown the formulas in order for the new data to appear. Apparently, every time there is a new form submission, google sheets changes the cell address in the formulas. Is there any way around this?
As JPV commented, the "pushing down of formulae" by form submissions may be counteracted by using an array formula (in row 2):
=ArrayFormula('Form Responses 1'!N2:N)
And as Akshin commented, if you were in fact bringing over a couple of columns for graphing purposes, you can do it all in one with QUERY. For example:
=QUERY('Form Responses 1'!A:N,"select A, N",1)

Resources