Subtotal with sumif(s)

millawitch

New Member
Joined
Jun 20, 2012
Messages
14
Office Version
  1. 365
Platform
  1. Windows
Hi all,

I have the following formula working but it looks a bit cumbersome - is there a way to streamline it?

=SUM(SUMPRODUCT(SUBTOTAL(9,OFFSET(Timekeeping[Units / Hours],ROW(Timekeeping[Units / Hours])-MIN(ROW(Timekeeping[Units / Hours])),0,1))*(Timekeeping[Date] > Billing!$A$2)),ROUND(SUMPRODUCT(SUBTOTAL(9,OFFSET(Timekeeping[Units / Hours],ROW(Timekeeping[Units / Hours])-MIN(ROW(Timekeeping[Units / Hours])),0,1))*(Timekeeping[Date] < =Billing!$A$2))/6,2))

Background: I need to have a total of hours recorded based on filtered columns, the formula very straight-forwardly used to be =SUBTOTAL(109,Timekeeping[Units / Hours]). After a certain date ("Billing!$A$2") timekeeping has been recorded in hours, whereas before it was recorded in units (1 unit = 10 min). To avoid having to convert numbers from one or the other every time I add new entries to the "Timekeeping" table, I came up with this formula.

Thanks! ;)
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.

Forum statistics

Threads
1,223,231
Messages
6,170,884
Members
452,364
Latest member
springate

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