Formula Sumproduct with Subtotal Time count

johnster

New Member
Joined
May 31, 2018
Messages
43
I've found a formule for counting the time (only the visible filtered cells) but there is stil an issue.

When i filter the column from 20:00 till 21:00 is see 4 values. The result of my formula give me 5 values.

"
Rich (BB code):
Formula: =SUMPRODUCT(($N$3:$N$9992>=S$1)*($N$3:$N$9992<T$1)*SUBTOTAL(2;OFFSET($N$3;ROW($N$3:$N$9992)-ROW($N$3);)))

Knipsel.PNG


Thx in advance
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
I can see no obvious reason for it to do that.

Try changing the time in T1 to 20:59:59, If that corrects the result then it would suggest that floating point precision is the cause.

I get the correct result with the visible data from your screen capture but have seen this happen once previously with european regional settings.
 
Upvote 0
I can see no obvious reason for it to do that.

Try changing the time in T1 to 20:59:59, If that corrects the result then it would suggest that floating point precision is the cause.

I get the correct result with the visible data from your screen capture but have seen this happen once previously with european regional settings.
It works, thanks so much.
 
Upvote 0
I would advise caution. You say that it works, but that depends on additional data.
If your timestamps are to the second then it might work with that one, but fail later with another.

One thing to remember with date and time in excel is that it doesn't lose precision with formatting. 21:00:59 still retains the 59 seconds if you change the format to only show hours and minutes. Although you can not see the seconds, a formula still can and it will still use them.
 
Upvote 0

Forum statistics

Threads
1,214,587
Messages
6,120,405
Members
448,958
Latest member
Hat4Life

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