Summing a Cell across all sheets formatted as Duration [duplicate] - google-sheets

This question already has answers here:
How to SUM duration in Google Sheets?
(5 answers)
Closed 8 months ago.
So i have a google sheets with multiple sheets for which i track my reading stats, each sheet is one book. I would like to have a totals sheet which displays some stats calculated for all my books(sheets).
For example i have cell with tracks the Duration a book has taken, its always the same cell in every sheet(I3) this cell uses the SUM() function to sum all the durations for each day.
Its formatted in the "Duration" mode in sheets it takes 01:20:59.000 and displays it as 1:20:59.
I would like a function which sums the duration for all for example I3 Cells in all my sheets.
I have tried various scripts i found to make this work, but non of them worked with the Duration Format just with plain numbers.

try:
=ARRAYFORMULA(TEXT(SUM(IFERROR(TIMEVALUE({Sheet1!I3; Sheet2!I3}))); "[h]:mm:ss"))

Related

How can I write a function in google sheets that gives me the group of 15 consecutive cells with the highest average? [duplicate]

This question already has answers here:
Google Sheets: Moving daily, weekly, monthly, and yearly averages
(2 answers)
Closed 24 days ago.
I've got a data set of 365 cells about the wave height per day, I want to figure out how to find when the highest average over 15 days is during the year. I am limited to using google sheets and have beginer to intermediate knowledge of google sheets which makes it hard to figure out how to write the function.
I have no clue how to get there, all i could figure out online is using the function to find the highest 10 values in a dataset, but not consecutive values.
With the use of SCAN, SEQUENCE and INDEX, you can navigate through the range, choosing ranges of 15 cells; and returning the average:
=SCAN("",SEQUENCE(COUNTA(A1:A)-14),LAMBDA(a,v,AVERAGE(INDEX(A:A,v):INDEX(A:A,v+14))))
Just by wrapping that into MAX would give you only the value. If you need also the range, can do something like this:
=SCAN("",SEQUENCE(COUNTA(A1:A)-14),LAMBDA(a,v,{"Rows: "&v&" to "&v+14,AVERAGE(INDEX(A:A,v):INDEX(A:A,v+14))}))
That would return:
With the help of SORTN you'll be able to find the highest value (or values, just change the first 1 after the closure of SCAN with the value you want):
=SORTN(SCAN("",SEQUENCE(COUNTA(A1:A)-14),LAMBDA(a,v,{"Rows: "&v&" to "&v+14,AVERAGE(INDEX(A:A,v):INDEX(A:A,v+14))})),1,1,2,0)
To have the actual values, use:
=LAMBDA(ind,FILTER(A:A,ROW(A:A)>=C1,ROW(A:A)<(C1+15)))(INDEX(SORTN(SCAN("",SEQUENCE(COUNTA(A1:A)-14),LAMBDA(a,v,{v,AVERAGE(INDEX(A:A,v):INDEX(A:A,v+14))})),1,1,2,0),,1))

Match and count in a vacation tracking sheet

My team has a vacation tracking calendar in Google Sheets. I'm trying to create a formula (for the red cells) to automatically count the number of days entered in the calendar by person and absence code.
I've tried a number of different ways to solve this using Countifs, Match and Index but it only works for a single range, yet I need to count one range for each month of the year.
Is there an easier way to do this than adding 12 similar formulas together.
Assuming you don't need a spill range you could just do a basic countif off of a filtered range on the name.
so if your data starts on A8 and goes all the way to column f (you'd want more), and you put the exact string you're searching above the cell in row 3, this should work:
=countif(filter($A$8:$F,$A$8:$A=$C3),D$2)
Here's a sample sheet from screen shot.

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

How can I count the number of items listed on a different google sheet based on dates in 2 different cells and if another cell is blank?

I have a google doc that tracks information about employee training (Example 1). I have another google doc that needs to summarize the information (Example 2) from multiple different sheets which mirror example 1 but for different teams.
Example 1: this sheet is tracking employees start dates, dates they finish training, and if they have quit. (there are multiple different docs all with the same format that I'm pulling from using importrange).
I need a formula that will count the number of employees currently in training. So count if start date is equal to or after today, end date is equal to or less than today, and the quit column is blank.
If the formula worked the way it should, and I was looking at the summary doc on 11/10/2021, it should report 4 people in the "# in Training" column on the table below (Example 2).
I have tried using an ArrayFormula with CountIfs to accomplish this, but it still pulls 0. Here is the formula I've been playing with:
=ArrayFormula(COUNTIFS('tracker'!$B$2:$B, "<="&TODAY(), 'tracker'!$C$2:$C, ">="&TODAY(), 'tracker'!$D$2:$D,""))
Give a try on below formula-
=COUNTIFS(B2:B8,"<=" & DATE(2021,11,10),C2:C8,">=" & DATE(2021,11,10),D2:D8,"")

Linking a fixed spreadsheet and a moving spreadsheet by cell value

I work for a small business that depends quite a lot on the weather. I’m trying to create a spreadsheet (in google sheets) to predict daily revenue. At the moment the spreadsheet simply multiplies last year’s corresponding day by the growth percentage to get this year’s daily values. I’m trying to include the weather forecast (15 days) in the calculation. I’ve managed to import the forecast successfully using an api tutorial that I found online (https://www.visualcrossing.com/weather-data), and include the forecast values in the revenue calculation.
Now for the issue:
*the revenue prediction is a spreadsheet with every row being a day of the year, making the spreadsheet 365 rows long
*the imported forecast (in another tab, not sure that’s relevant) is only 15 rows long and updates every day, meaning that it remains that length. No new row is added during the update: the data just shift one row up and the first day disappears while a new day takes the bottom row.
My formula in the revenue tab identifies the weather data in the weather tab by row but when I pull the formula down for the whole year (down 365 rows, that is), only the first 15 rows refer to existing data in the weather tab. -> Not only are the results obtained based on the wrong row as soon as the weather tab updates on day 2, but they are also referring to totally empty cells from day 16 on.
So my questions are:
*is there a way to force the daily weather forecast to remain on its row and add a new row every day, or failing that,
*is there a way for the formula to recognize the matching day cells and use the value of the cell x columns to the right of it, effectively skipping the row referencing altogether
I’ve added a very simplified sketch of the spreadsheets for the more visual helpers out here
Apologies if this is unclear, I do not have a tech background but am happy to clarify anything if needed.
-- Edit: Here is a screenshot of the revenue tab. The expected output is in column K. The values in it at the moment are incorrect.
Seems like you just need a dynamic way to match the dates? I can't tell if you meant to have prior year data in other tab, but this spreadsheet matches your example and returns the value irrespective of the row order.
The formula being used (in the top row) is:
=B1*index(WeatherTab!B:B,match(A1,WeatherTab!A:A,))*index(WeatherTab!C:C,match(A1,WeatherTab!A:A,))

Resources