How to output Tick Box Grid Responses from Google Forms to Google Sheets as Separate Columns (plus calculates Timezone)? - forms

I need something where our Team Members can select their regular Hours of Availability during the week, in 1 hour intervals, and the results of all Team Members can be seen in a Spreadsheet (and if they fill it out 2 or more times, it will just update their last response). From there, selecting Meeting Times where specific Members can meet should be a lot simpler!
It occurred to me recently that Google Forms and Google Sheets could be one of the best solutions here! But I really don't have much experience with Google Apps Script (which it looks like I'm going to need to do what I want it to do), and so I have some questions:
I have a 7 x 24 (7 Days of the Week by 24 1-Hour Intervals) Tick Box Grid (see linked image here). How can I set it up so it can output each Row+Column in its own separate Column in the output Google Sheet (see linked image here for my preferred output for a single Day)?
In case you're wondering what is going on with the 3rd Row: I have SUM Functions =iferror(counta(L4:L62)) (where L is the Letter of the Column) to Total the "Checked Responses" in each Column for an easy glance of the number of Xs (Yeses) for each Hour Block Column.
How can I customize each Row+Column Checked Response so it outputs as a simple letter X?
I also have a Dropdown Timezone Question, where it asks the User select their Timezone from 1 of the 25 available Timezones in the world. I would like it so their responses to the Hours of Availability Tick Box Grid is modified to match their responses in GMT. So for example, if I select my Timezone as GMT -4, and in the Tick Box Grid I select 12AM to 1AM on Sunday, the Google Sheet will include an X under 7PM to 8PM on Saturday?
Am I asking for too much from Google Forms + Google Sheets API here? And if I am, maybe there is a better Cloud Program I could use for handling this?

So #MattKing (Matthew King) worked closely with me yesterday to get my Tick Box Grid to output to Google Sheets as I intended, as well as handling Timezone Conersion! You can see the Test Results in here:
https://docs.google.com/spreadsheets/d/1g5S5Nyfwr8eHWyn-UXVfdbVj8tdZeY-lU20C2VxuCZ8/edit
I should first mention that the Form Output Sheet (called Form responses) should NOT be modified. Also NO Google API Scripting has been required to get Google Sheets to format the Form Results as I want to. Instead, new Sheets with Formulas (rather complex ones might I add) was the way to go!
To output 1 Hour increments of 24 hours for 7 days: =ARRAYFORMULA(SEQUENCE(1,24*7,0)/24+1)
Each Name in "Form Responses" (in Column A) can be output, in alphabetical order, as follows: =QUERY({'Form responses'!B2:C},"select Col1 where Col2 is not null order by Col1")
Hours of Availability in "Form Responses" (in Columns E through AB) can be output (where each Column is 1 of 24 hours in 1 of 7 days) as follows: =IF($A4="",,IF(ISNUMBER(MATCH($A4&TEXT(B$2,"ddd hh"),UTCData!$A:$A,0)),"X",))
If I want to have separate Meetings in separate Sheets, and I have the Meeting Name (selected as Checkboxes in the Form) in A1, then I can set it up so only the Names of the People who checked that Meeting will be shared as follows: =QUERY({'Form responses'!B2:C},"select Col1 where Col2 Contains'"&A1&"' order by Col1")
He also created for me 2 Sheets that handle more Formula Conversions:
Flattened Form Sheet
Flattened Formula: =ARRAYFORMULA(QUERY(SPLIT(FLATTEN('Form responses'!B2:B&"|"&'Form responses'!C2:C&"|"&'Form responses'!D2:D&"|"&MID('Form responses'!E1:AB1,64,20)&"|"&'Form responses'!E2:AB),"|",0,0),"where Col5<>''"))
Extract Times: =ARRAYFORMULA(IF(D2:D="",,SPLIT(MID(D2:D,2,LEN(D2:D)-2)," to ",0)))
UTC Conversion: =ARRAYFORMULA(IFERROR(MOD(MATCH(SPLIT(E2:E,", ",0),TITLE!C10:I10,0),7)+F2:F+C2:C/24))
UTCData Sheet
Name&UTCDayTimeCombos: =ARRAYFORMULA(QUERY(FLATTEN(IF('Flattened Form'!H2:N="",,'Flattened Form'!A2:A&TEXT('Flattened Form'!H2:N,"ddd hh"))),"where Col1<>''"))
In Column C2 - C8, it lists Sunday through Saturday
If you need someone to help you with your Google Sheets and Forms, I can't recommend Matt's help more!

Related

Google sheets dynamic list using the FILTER function with dates?

I'm trying to create a simple checkbook register on one sheet, then have monthly spreads where the data is separated out by that month. I've used =FILTER() before to automatically generate a list on a separate sheet based on the conditions set. But for some reason I'm struggling when it comes to dates.
Here's the function I'm trying to use (which isn't quite right)
=FILTER('Checkbook Register'!B14:J1000,TEXT('Checkbook Register'!B13:B1000, "mmmm")=B2)
B2 has the current month as a string December in this case.
The data I'm trying to copy to a another sheet as it's entered is in this format
Date
No.
Description
Debit
Credit
Balance
Cleared
11/20/2021
#
Transact 1
1.00
6.00
y
12/1/2021
#
Transact 2
1.00
5.00
y
12/1/2021
#
Transact 3
1.00
4.00
n
What I'd like it to do is if the Date column matches the current month listed in B2 then add those transaction lines to the new sheet. I feel like I'm making this more complicated than it really is.
I've used this formula before to make the list if the checkbox is true
=FILTER(T5:X22,S5:S22=TRUE)
and loved the functionality of it. I thought something similar would be very useful in my personal budgeting spreadsheet rather than entering transactions on each individual monthly spread. I could track them on one main sheet and use the filter function to split them out.
Any advice would be greatly appreciated!
I was close! In case anyone uses this in the future, my ranges were one row off. ^-^
B14:J1000 and B13:B1000
=FILTER('Checkbook Register'!B14:J1000,TEXT('Checkbook Register'!B14:B1000, "mmmm")=B2)
After correcting, this worked as expected.
just in case B2 = December and B column contains empty cells use:
=FILTER('Checkbook Register'!B14:J,
TEXT('Checkbook Register'!B14:B, "mmmm")=B2,
'Checkbook Register'!B14:B<>"")

Query for text and return corresponding value, within a date range

Working on moving an excel sheet to google sheets.
One of the areas I have working quite nicely in excel is finding a paycheck value out of a list of transactions.
The transactions list is a running sheet from 2018. The current tab has cells A1 and A2 specifying the beginning and end days, ie 7/1/19 7/31/19.
The formula takes those two dates and searches for the keywords, returns the first, second or third instance (for this formula it's the first)
Trying to figure out how to best move this type of query over to google sheets.
Any advise?
=IFERROR(INDEX([Transactions.xlsx]Transactions!$D$2:$D$8996,SMALL(IF(([Transactions.xlsx]Transactions!$B$2:$B$8996="DFAS-CLEVELAND FED SALARY ***********xxxx")+([Transactions.xlsx]Transactions!$A$2:$A$8996>=$A$1)+([Transactions.xlsx]Transactions!$A$2:$A$8996<=$A$2)=3,ROW([Transactions.xlsx]Transactions!$B$2:$B$8996)-ROW(INDEX([Transactions.xlsx]Transactions!$B$2:$B$8996,1,1))+1),1)),"None")
try something like:
=QUERY(2018!A:B,
"select B
where A >= date '"&TEXT(A1, "yyyy-mm-dd")&"'
and A <= date '"&TEXT(A2, "yyyy-mm-dd")&"'
limit 3", 0)

Query/filter by 3 AND criteria + countif

I'm trying to create a dynamic dashboard for tracking student attendance patterns. When you choose the student from the drop-down in cell C4 in the Student Tracker, the data and charts all change dynamically. The way I've created dynamic charts is by "hiding" queries and other calculations behind the charts and making the text the same color as the background so that they aren't visible. Here's a shared copy of the dashboard with anonymized data: https://docs.google.com/spreadsheets/d/1nyI6h8aiPcJiqPIDWE6AsmCIPt_Vhj0dHdKtmsoqfuk/edit
I'm trying to create a chart that will show monthly patterns for the selected student, looking at the percentage of times they were marked "Present", "Excused absence (E)", etc each month (very similar to the days of the week chart).
This is the formula I tried:
=Countif(Query(ATTDATABASE!$A$2:$M,"select E,G,I,K,M where C='"&$C$4&"' and B >= date '"&TEXT(8/1/2019,"yyyy-MM-dd")&"' and B <= date '"&TEXT(8/31/2019,"yyyy-MM-dd")&"'"),"Present")
It keeps counting 0, even though I know the selected student was marked present in August. Even if I take out the other columns and just leave it as "select E...", it still counts as zero, even though I know the student was marked present on a Monday (column E) in August. I know there's got to be a way to do this, but my Google Sheets chops just aren't quite strong enough yet to figure out the magic combo/syntax.
try:
=COUNTIF(IFERROR(QUERY(ATTDATABASE!$A$2:$M,
"select E,G,I,K,M
where C='"&$C$4&"'
and year(D) = 2019
and month(D)+1 ="&MONTH(LEFT($G20, 3)&1))), "Present")

How to increment date in arrayformula sumifs in google sheets?

I have adapted a formula from another post and it works, yet I need to increment the formula down hundreds of rows, but I cannot figure out how to get the dates to increase.
I have a Google Form that sends data to its spreadsheet. There may be several entries per date and I want the data to be summed on the 2nd sheet before I graph it.
Data
A B
6/3/2016 06:06:00 2
6/3/2016 11:06:00 2
6/4/2016 07:05:00 1
6/4/2016 09:10:00 5
Result
A B
6/3 4
6/4
B2 =ArrayFormula(SUM(If((Data!A$2:A<DATE(2016,6,5))*(Data!A$2:A>DATE(2016,6,4)),Data!B$2:B)))
I will have dates that run the entire year, so I need an easy way to increment the dates. Also, if you have a way to grab data from the exact date needed, that would be nice too (instead of giving the date range).
A query formula may work better in this example, such as:
=QUERY({ARRAYFORMULA(TRUNC('Form responses 1'!A2:A)),'Form responses 1'!B2:B},"select Col1,sum(Col2) where Col1 >0 group by Col1 label Col1'Date' format Col1 'mm-dd'")
Amend the sheet name and ranges as appropriate

Show Value at specific date in spreadsheet - no queries

I would like to show a specific value at a certain date.
Example, I have a list of numbers and on Monday I want to count all the numbers that are in the list on that specific date. The list grows until Tuesday, so the number I will show on Tuesday will be bigger and so on.
Is there a non SQL solution for this? As I did find this thread:
Thread
but I have no idea how to do SQL in spreadsheet.
Thanks
So you can try this:
On Businessweek1 B1
=if(AND(DAY(TODAY())>=1;DAY(TODAY())<=7;WEEKDAY(TODAY())=COLUMN(A1));countif(A2:A100; "warte auf GO");)
Then drag this across 7 columns.
On Businessweek2 B1
=if(AND(DAY(TODAY())>=8;DAY(TODAY())<=14;WEEKDAY(TODAY())=COLUMN(A1));countif(A2:A100; "warte auf GO");)
Then drag this across 7 columns.
And so on