Summing with a start/end date but visible cells only.

Vanilla_Excel

New Member
Joined
Aug 28, 2021
Messages
7
Office Version
  1. 365
Platform
  1. Windows
I have a simple spread sheet that has a list of production hours which can be filtered by location (LA,TJ,CH) and if event (y or n). each date technically represents a unique order, so the dates column is not generally filtered. Start date and end date is set for a future week to gauge production hours needed at a particular location.

I have tried both SUMIFS and SUMPRODUCT, but I can't seem to get the syntax to work.

=SUMIFS(Table6[Est. ProdHrs],Table6[Due Date],">="&A146,Table6[Due Date],"<="&B146)*SUBTOTAL(102,OFFSET(D2,ROW(Table6[Est. ProdHrs])-MIN(ROW(Table6[Est. ProdHrs])),0,1,1))

=SUMPRODUCT((Table6[Due Date]>=A146)*(Table6[Due Date]<=B146)*Table6[Est. ProdHrs])*SUBTOTAL(102,OFFSET(D2,ROW(Table6[Est. ProdHrs])-MIN(ROW(Table6[Est. ProdHrs])),0,1,1))

I've scoured Multiple sites (including this one) and videos and I'm at my wits end. I think I got close, but I can't find my error.

Thanks in advance for all help given!
 

Attachments

  • SUMIFS TEST.PNG
    SUMIFS TEST.PNG
    49.8 KB · Views: 14
Sorry, I forgot to add the last argument to the second xmatch function. I think that this should be correct now although I don't have time to test it at the moment.
Note that it will only work if the dates are sorted in ascending order as mentioned in earlier posts.
Excel Formula:
=SUBTOTAL(109,INDEX(Table6[Est. ProdHrs],XMATCH(A146,Table6[Due Date],1)):INDEX(Table6[Est. ProdHrs],XMATCH(B146,Table6[Due Date],-1,-1)))
That did it! Thanks again for your help, it is greatly appreciated!
 
Upvote 0

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.

Forum statistics

Threads
1,215,457
Messages
6,124,941
Members
449,197
Latest member
k_bs

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