Use a Dynamic Range with Dates as a Criteria in FILTER Function

LuisPulido

New Member
Joined
Apr 27, 2021
Messages
4
Office Version
  1. 365
Platform
  1. Windows
So I manage to create a dynamic range of dates with all the 1st of month between a period of time.

1691962854610.png

What I want to do, is sum all the expenses of respective month from another table. That result should be another dynamic range of the same size as the one with the dates in order to create the following plot
1691963108357.png

The previous plot is made with a SUMIFS and works great, however the Sum need to be filter by some values from another table and as SUMIFS do not support to use formulas in the criteria range I need to use FILTER inside of a SUM and the I can multiply the result by SEQUENCE(X,,,0) to have the same size

The formula that I am using is:

=SEQUENCE(ROWS(X2#))*
SUM(FILTER(Table1[Sales],
(Table1[Date]>=X2#)*
(Table1[Date]<=EOMONTH(--X2#,0))
))

1691964255656.png
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
Have you tried the SUBTOTAL() function, this allows for sum or count or average etc but only shows the total for the visible cells, SUM does not vary with filtering. Also a SUBTOTAL() value will not be included in another SUBTOTAL, so you can put a number of SUBTOTALs in a column without effecting the value at the bottom.
 
Upvote 0
Have you tried the SUBTOTAL() function, this allows for sum or count or average etc but only shows the total for the visible cells, SUM does not vary with filtering. Also a SUBTOTAL() value will not be included in another SUBTOTAL, so you can put a number of SUBTOTALs in a column without effecting the value at the bottom.
I don't explain my self properly. The filters are not for the table, the filters will filter the formulas. What I am making is a dashboard, so the user will not access to the tables. The user will only use some activeX forms to apply filters to the calculations. Power Bi and Power Pivot are not an option Neither.

1691972582111.png
 
Upvote 0
Try
Excel Formula:
=BYROW(X2#,LAMBDA(_a,
SUM(FILTER(Table1[Sales],
(Table1[Date]>=_a)*
(Table1[Date]<=EOMONTH(--_a,0))
))))
 
Upvote 0
Why can't you use sumifs like
Excel Formula:
=sumifs(Table1[Sales],Table1[Date],">="&X2#,Table1[Date],"<="&EOMONTH(--X2#,0))
 
Upvote 0

Forum statistics

Threads
1,215,069
Messages
6,122,959
Members
449,096
Latest member
Anshu121

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