Google Sheets - TimeValue Between 2 Dates

sprigelz

Board Regular
Joined
Jan 7, 2016
Messages
98
Office Version
  1. 365
Platform
  1. Windows
Good afternoon,

I am trying to get a timevalue between 2 dates. I was able to find and implement the below formula, but this just looks at the "Duration" column as a whole and doesn't have the date check.

Excel Formula:
=arrayformula(text(sum(iferror(timevalue('Hunting Log'!C2:C3))),"[h]:mm:ss"))

Start Date is in cell D3
End Date is in cell D4

The above formula works perfectly fine, like I said just trying to add the additional function to it. Should look in Hunting Log B:B for date data.
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
below is my table copied from gsheets:
i have the bottom row formatted as duration
you could use either d5 as is, or if your date and time are separate use g5

CDEFG
3start3/12/2023 4:31:01 PM3/12/20234:31:01 PM
4end3/15/2023 8:59:00 AM3/15/20238:59:00 AM
52:41:103:00:00-0:18:502:41:10

here is in excel w/ the same formulas:

Book1
CDEFG
3start3/12/23 4:31 PM3/12/20234:31:01 PM
4end3/15/23 8:59 AM3/15/20238:59:00 AM
52:41:103:00:00-0.0130792:41:10
Sheet1
Cell Formulas
RangeFormula
D5:F5D5=(D4-D3)/24
G5G5=E5+F5
 
Upvote 0
Hmm, that's not exactly how I have it set-up.

#DateTime Spent (Duration)
114-Mar-20233:43:40
215-Mar-20232:30:58

On another tab I am building a dashboard with the total month values. So I need something that looks between 1 Mar - 31 Mar and adds the "Time Spent (Duration)" column.

The previously linked, and listed formula below, works perfectly fine for what I want it to do. Only problem is it does not look between those 2 dates. So I would have to manually adjust a part of the function for each month.
Excel Formula:
=arrayformula(text(sum(iferror(timevalue('Hunting Log'!C2:C3))),"[h]:mm:ss"))
 
Upvote 0
can you give more fo an example of what you have and what you're looking for?
or as this is google sheets, if you want to make a shared un-editable copy, could look at what you have
 
Upvote 0

Forum statistics

Threads
1,223,937
Messages
6,175,518
Members
452,650
Latest member
Tinfish

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top