Simple time functions in Excel/Google Sheets - google-sheets

I am creating a tool for my restaurant. Everyday, I have employees input their sales numbers into a Google Form on their phones. The results of which are archived in a Google Sheets spreadsheet as 'FormResults'.
I need a way to auto-write only the most recent values of each employee's formResults data into the appropriate slots to do the daily calculations of tips in sheet1.
I also want to archive the form data. This is why I don't just manually input the data daily into the calculator.
This is my crude If statement:
If {A15=today,B15=Mike} then write Contents of C15 into this cell
A1,B2,C2 are in sheet2 and I want sheet1 to only display the most recent value of each of these.

Do either of these work as you want (assuming cell A1 contains the employee name)?
To return the data from most recent date:
=MAX(FILTER(sheet2!C:C,sheet2!B:B=A1))
Or to return data from today
=FILTER(sheet2!C:C,sheet2!B:B=A1,INT(sheet2!A:A)=TODAY())

Related

Finding Latest Date Based on Dataset in Google Sheets

I have a dataset in 2 separate worksheets.
In worksheet one, we keep track of website's that we have scanned and when we have scanned them last. Each website will have multiple rows of data as each site is typically scanned each week.
In worksheet two, we have our database of websites that we can along with additional info pertaining to those websites.
I am wondering if there is a formula that we can use in worksheet two that will pull the last date scanned from our data in worksheet one?
A reference spreadsheet is here: https://docs.google.com/spreadsheets/d/1clrqDaWiKa2xCAgdZxcVfW_g06MmG7LSrp_fUDF0_Sw/edit?usp=sharing
I would like the "Date Last Scanned" in worksheet two to show the most recent date shown in column B on worksheet one.
Thanks in advance!
I have a dataset in 2 separate worksheets.
In worksheet one, we keep track of website's that we have scanned and when we have scanned them last. Each website will have multiple rows of data as each site is typically scanned each week.
In worksheet two, we have our database of websites that we can along with additional info pertaining to those websites.
I am wondering if there is a formula that we can use in worksheet two that will pull the last date scanned from our data in worksheet one?
A reference spreadsheet is here: https://docs.google.com/spreadsheets/d/1clrqDaWiKa2xCAgdZxcVfW_g06MmG7LSrp_fUDF0_Sw/edit?usp=sharing
I would like the "Date Last Scanned" in worksheet two to show the most recent date shown in column B on worksheet one.
Thanks in advance!
Put this formula in cell 'Dataset 2'!C2:
=to_date( maxifs('Dataset 1'!B$2:B, 'Dataset 1'!A$2:A, B2) )
Format the cell as Format > Number > Date or another date format of your preference. Then copy the cell down as far as needed.

Arrayformula for Index Match multiple columns with date values

I am collecting data on intervals and want to display a summary of that data on a single line in a new sheet.
https://docs.google.com/spreadsheets/d/1EOV4-VwVfwWvhwQ24qkQbCRGxUp74oe0dLWrbj0wiNE/edit#gid=566541214
Grade Data Sheet
Each batch of data comes in by date with a Name, Course and Grade like below
Raw data is like this for a large number of Name / Course / Grade:
Date
Name
Course
Grade
10/1/2022
Joe
Math
65-D
10/15/2022
Joe
Math
58-F
10/30/2022
Joe
Math
50-F
Summary Sheet
Single line that takes each unique Name-Course pair and I'm attempting to lookup a grade for each date column.
(note: I'm trying to extract the dates in the columns dynamically as the Grade Data sheet expands)
So I've successfully extracted the Dates to create new columns, and I am trying to create an index-match that grabs the column date and creates an array of DATE-NAME-COURSE and matches DATE-NAME-COURSE on the Grade Data sheet to return the grade for that student on the Date. The formula works for the first row, but when it fills down it returns the value of the first match.
I can't quite figure out how to reference the single date cell into the array while dynamically filling down. Not sure if I a different approach, but hopefully this makes sense.
=arrayformula(if(len($A2:$A),(index(GradeData!$D2:$D,match(TEXT(C$1,"yyyy-mm-dd")&$A2:$A&$B2:$B,TEXT(GradeData!$A2:$A,"yyyy-mm-dd")&GradeData!$B2:$B&GradeData!$C2:$C,0))),""))`
The goal is to have Grade Data populate automatically, and the Summary page to add a column for each new date and fill data down for each student.
Thanks in advance, I have shared the actual sheet above so you can see the data
I've attempted several different ways but can't quite get the dynamic array matches with the date formatting to work.
=arrayformula(if(len($A2:$A),(index(GradeData!$D2:$D,match(TEXT(C$1,"yyyy-mm-dd")&$A2:$A&$B2:$B,TEXT(GradeData!$A2:$A,"yyyy-mm-dd")&GradeData!$B2:$B&GradeData!$C2:$C,0))),""))
Thank you!
As far as I've seen the issue in your sheet is that the dates of the header do not match the dates of your source data. I've added a new header line:
=LAMBDA(dates,FILTER(dates,regexmatch(dates,"/")))(Transpose(Unique(arrayformula(left(GradeDataVlookup!A4:A,10)))))
And just put an IFERROR in order to avoid all the errors of the values without matches:
=arrayformula(if(len($A$2:$A),iferror(vlookup(TEXT(C$1,"MM/DD/YYYY")&$A2:$A&$B2:$B,GradeDataVlookup!$A:$E,5,FALSE),""),""))
PS: with MAP or MAKEARRAY you could summarize all the table in just one formula

How to create a Google Sheet table of ranked person by date and rank from a list

I have a Google Sheet with daily ranked items expanding with new data everyday in the Raw Data Table A2:C.
I would like to generate a report matrix similar to table in E2:J using one formula so that we don't need to manually copy formulas in each cells in the report table from time to time.
It would be ideal to have one formula at cell E2 (or E3, F1, F2) only that will automatically generate as many rows and columns in the report table based on the data in Raw Data Table. This way, the report table will not needed to be maintained on a daily basis (like copying formula everyday as data expanded).
There are less elegant ways to do it like pre-copy formula into a large number of cells or using Google App Script to generate the table. However, I believe an advance query() or a complex formula mixing query(), filters() and/or arrayformula() can do the job! Just wonder if anyone of the Google Sheets query() expert can help!
try:
=QUERY(A2:C; "select A,max(C) where A is not null group by A pivot B"; 1)
Here's a possible solution:
=ArrayFormula(LAMBDA(dates,ranks,{A2,ranks;dates,IFNA(VLOOKUP(dates&ranks,{A3:A&B3:B,C3:C},2,0))})
(UNIQUE(A3:A),TRANSPOSE(UNIQUE(SORT(B3:B)))))

Provide a summary sheet based on data from other sheet in same workbook

I am creating a sheet where I am tracking the working hours of some employees in google sheets.
Each month I need to provide a summary per employee to sign. Until now I was doing it by hand, but there must be some better way to do it.
A test sheet can be found here, the first sheet is data, the second sheet is the summary I am looking for.
https://docs.google.com/spreadsheets/d/1LmJYMqJTEpjSKNY4qFXhLRaBbotj7lUEHauynzHISwg/edit?usp=sharing
Is there any way to use an array formula with some filters for Employee name and a date range to accomplish this?

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