How to Count Timestamp on Google Spreadsheets? - google-sheets

My responses are timestamped as soon as anyone submits a survey. I wanted to count those timestamp monthwise.
URL - https://docs.google.com/spreadsheet/ccc?key=0AkpZp6MVqYv1dE5SZjJIODB1WF9nZDR6b1ZJZjFPenc&usp=sharing
I wanted to find out number of positive responses for a particular question (lets say Q1) for a particular month (lets say May)
Column G is not founded out based on the timestamp of Q1, I had asked the user the month, but that's not the correct way to do so, so I have stopped asking the user to enter the month.

First you have to overcome the fact that the timestamp isn't compatible with googles date format. No biggie,... luckily it looks like you have a fixed format ie DD/MM/YYYY. So you can use the LEFT and RIGHT formulas like so =right(left(a2,5),2) This will give you the month in text, ie 05.
Great.
Now for the harder stuff. If you have the newer google spreadsheets, you can simply use countifs to the effect of:
=countifs(arrayformula(right(left(A$2:A,5),2)),"=05",B$2:B,"=Positive")
For each month, replace the "=05" with the the date number you want. You could also make a month lookup chart for all months and questions so that you don't have to modify the formula for each month and quesiton. For this you replace the "=05" with =[cell number containing month number as text] (NOTE: for making a lookup key, you will have to pay close attention to the fact that you are getting TEXT in the formula above vice a number. There is a difference and they are not compatible as-is.)
Let's say you don't have the new google spreadsheets. Then you can use the old sumproduct() and if(). Yes, it is old. See the following:
=sumproduct(arrayformula(if(right(left(A$2:A,5),2)="05",1,0)),arrayformula(if(B$2:B="Positive",1,0)))
Note in both of these, you need to use arrayformula to convert the column with the timestamp into something useable. If you want to make this part easier by removing the parseing functions (LEFT() and RIGHT()) you need to change the timestamp format to be MM/DD/YYYY. Then you can plug in the the MONTH(DATE) formula and it will be done.
Then make a master sheet like so (note my formula has a "'" in it to make it visible for purposes of demonstration, you should remove it.):
Careful inspection might note that the count is wrong. That is because when I imported your timestamps, times like "02/06/2014 ..." were interpreted to mean "February 06" because of google's auto-formatting. In your sheet you will get the correct count using this formula, because of the way your timestamp is auto-populated.
HINT: To make the month a text you need to enter ="05" in the Month column
Please let me know how you make out.

Related

set times with miliseconds in google sheet [duplicate]

This question already has answers here:
How to SUM duration in Google Sheets?
(5 answers)
Closed 8 months ago.
some time ago I ported an old timesheet to the google-timesheet to be able to share it online and have others modify it but didn't keeped it so I don't remember how I manage to do.
The goal is to compare two timing sheet, today I wanted to edit the sheet to be able add new datas and write timing in separate page sheet which simplify the comparation as I'll just have to import the data from the page and not rewrite it all the time. My issue is that I'm not enable to replicate on my new pages the format. What I would like is to have this exemple working
Cities
Time
Helsinki
2:04.820
Travemünde
4:03.290
Hambourg
0:30.900
Hanovre
2:28.610
Francfort
4:53.470
Mannheim
1:35.170
Strasbourg
2:13.650
Berne
2:25.190
Genève
2:22.620
Lyon
2:24.000
Marseille
3:34.550
Marseille (ferry)
Palerme
2:28.670
Catania
4:07.670
Total
=SUM(above)
so that I can replicate the format on the other pages as I don't understand why it worked before but not now.
mm:ss.000 is the format I would like to have, but atm my format is [h]:mm:ss.000 and it seems that the hour markdown is necesary so I don't really mind if we need to keep the hour.
This is completely possible with google sheets. Enter the data in the format hh:mm:ss.ms, and use sum() (with a range, obv.) to sum the column. Then select the whole colume and apply a custom number format (data-> custom time/date). Using the dropdown to get the parts and typing the separators you can get Minute(1): Seconds(1).Milliseconds(3) which seems to be what you want.
For sheets to recognise the cell entry as a time it needs the hh: part. But you can certainly hide that in the display.
Demo Spreadsheet
If the spreadsheet locale is set to something which uses , for the decimal point, you need to use that instead of . Google could definitely make that a lot clearer. If you have the time you might even want to open a bug report with them, as the examples in their docs don't work when the locale requires a ,.
As a bonus, you can bulk-convert using a formula like =replace(B2; find("."; B2); 1; ",") * 1 (where B2 is the cell to be converted). Drag down, copy and paste the values, and then format if need be.
use:
=ARRAYFORMULA(TEXT(SUM(IFERROR(TIMEVALUE("0:"&B1:B15))); "[m]:ss.000"))

Google Sheets - SUMIFS using date ranges as criteria shows wrong values

I am creating a financial overview tool in which I want to make sums of income/costs/profit - all summarised based on the month of the year in which those business cases were finished.
I ran into a problem with the SUMIFS formula not showing a correct value. Some months show correct value using a first formula, some only using the second, etc.
Google Spreadsheet Link (all important numbers are randomised)
I tried three options : (February as an example)
=SUMIFS(input!H3:H200;input!M3:M200;">"&DATUM(2022;1;31);input!M3:M200;"<"&DATUM(2022;3;1))
=>>This way I wanted to limit the SUMIF by only choosing cells with date > January but < March
=SUMIFS(input!H3:H200;input!M3:M200;">"&DATUM(2022;2;0);input!M3:M200;"<"&DATUM(2022;2;31))
=>>Limiting the SUMIF by choosing cells with date range higher than 2022/2/0 and lower than 2022/2/32 (unreachable dates)
=SUMIFS(input!H3:H200;input!M3:M200;">="&DATUM(2022;2;1);input!M3:M200;"<="&DATUM(2022;2;31))
=>>Limiting the SUMIF by choosing cells with date range higher and including 2022/2/1 and lower + including 2022/2/31 (unreachable dates)
Why didnt i just refer to a cell with the sum already calculated? Because the input list is an excel export from our crm platform which is never the same and I want to create something that does the work for me.
Why didnt I use index + vlookup to simply find the sum value based on the keyword "month name" + column number? Because I need to use a similar formula as sumifs in the next columns that are not shown yet. If there is no direct solution to my problem then I will resort to using the index+vlookup.
Changing the dates on the months that don't coincide solves the issue.
For example for May:
February 2022 had 28 days but on the function for May you used the 31st of february:
=SUMIFS(input!G3:G200;input!M3:M200;">"&DATE(**2022;2;31**);input!M3:M200;">"&DATE(2022;4;1))
and the result is:
If instead I change the March function to:
SUMIFS(input!G3:G200;input!M3:M200;">"&DATE(2022;2;28);input!M3:M200;"<"&DATE(2022;4;1))
The result gets corrected as it should.

Calculating average for more than one month of data

I am writing some formulas that will make up a dashboard that allows for a dynamic look-up of change in waiting times for admission into a hospital. In this case, what I want to do is create a lookback period of 1 month, 3 months, 6 months, and 1 year to see how waiting times have changed during this time at a few locations. It's a bit of a complex issue, but the stripped down data and my example code can be found here (fully shared for editing).
I have successfully gotten the correct formulas for finding 1 month worth of change, but how to apprroach more than 1 month's worth of data eludes me and this is especially problamatic because the date formatting is not standard excel/google sheets data format. As this data will be continously fed into the spreadsheet, I don't think I have the option to modify it either so I think the only option is to come up with some pretty funky formulas that treat months as text. Alternatively, I guess I can also try to make a formula that reformats the text into valid google sheets dates and then use that to make calculations but then while I could probably write that formula, I'd still not know how to get multiple months worth of data processed. Can anyone help take a look at the sheet? (feel free to copy/edit the file if necessary).
try like this:
=QUERY({INDEX(SPLIT(Data!A3:A, "T"),,1), Data!B3:C},
"select avg(Col3)
where Col1 >= "&DATEVALUE(EOMONTH(TODAY(), -4)+1)&"
group by Col2
label avg(Col3)''")
spreadsheet demo

Multiple criteria Countif unable to match due to date range, importrange

I am attempting to build a live dashboard for our lovely mechanics to see how many services they have completed in a day. The majority of the time it will be used to only show services from a certain mechanic on today's date, however I would like to be able to change the date it shows date for and so would like to be able to grab that criteria from a certain cell in sheet.
My current thinking is that the dashboard would have a formula like this:
=COUNTIFS(
IMPORTRANGE(
"https://docs.google.com/spreadsheets/d/1bx65qPAChwZ8uxwJsMfh-w5uALdKVdnn8x7LXD6J3zs",
"Servicing!A:A"),
D1,
IMPORTRANGE(
"https://docs.google.com/spreadsheets/d/1bx65qPAChwZ8uxwJsMfh-w5uALdKVdnn8x7LXD6J3zs",
"Servicing!C:C"),
C7)
D1 is where i can put in the date. C7 is where the mechanics name is held. My thinking is that this is not working as the data is populated using a google form. This google form records a timestamp in the following way '3/13/2020 12:09:56' Meaning that It will only match this data if the exact same time matches. Is there a way to make it search for ALL records on a date instead of all from a precise time?
Thanks for reading!
I was able to remove the time from the google forms output by adding and extra column and using this formula
=TO_DATE(DATEVALUE(B805))
B805 is filled by the time stamp from the google form
I then made my formula search for the info in the new colum with the above in each cell. It worked! :)

Dynamic Match Formula based on Date Criteria (G-sheets)

I'm looking to return a match on an array of data, depending on what the current date is.
Sheet located here for reference: (https://docs.google.com/spreadsheets/d/1jHw8y8AObnvJEW3YiSb_kGXZFfxHW96UjfFh_6NVaXQ/edit?usp=sharing)
Essentially I have 10 workers that can possibly appear on the roster, which will vary day to day. I'd like to link this to a google script which will automatically trigger an email to the workers that will be in the office the next day.
My issue is that I'm not sure how to create a dynamic reference so that my index-match formula knows which column to refer to. I'd like the formula to detect what tomorrow's date is, and as such return a 1 or 0 for who is rostered for the day. I've tried several Index-match-match methods but with no avail, as I have a broad range of potential columns to return data from.
Hope this makes sense, any help would be much appreciated.

Resources