Excluding dates in summing up a range

sharshra

Active Member
Joined
Mar 20, 2013
Messages
404
Office Version
  1. 365
In a table, I have to filter & sum the rows. But there is a date in the range & due to this, the result is not correct. Can the experts advise how to overcome this problem?

Sample table is shown below. In the base data, there is date field between amount 1 & amount 2. In the summary table, I´m using filter to sum up the amount based on year. But due to the date field in between, the results are not correct. If I remove the date field, I´m getting the correct result from filter function. But, I can´t change the table layout.

Base data -
excel problems.xlsx
CDEF
3monthamount 1dateamount 2
4ene-221002-ene-22
5feb-232013-feb-234
6mar-233030-mar-236
7abr-244026-abr-248
8may-245017-may-243
9jun-246020-jun-246
Sheet4


Summary -
excel problems.xlsx
IJ
3yeartotal
4202244573
5202390045
62024136467
Sheet4
Cell Formulas
RangeFormula
J4:J6J4=SUM(FILTER($D$4:$F$9,($C$4:$C$9>=DATE(I4,1,1))*($C$4:$C$9<=DATE(I4,12,31))))
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
How about
Excel Formula:
=SUM(FILTER(choosecols($D$4:$F$9,1,3),($C$4:$C$9>=DATE(I4,1,1))*($C$4:$C$9<=DATE(I4,12,31))))
 
Upvote 0
Thanks, @Fluff. I also thought about it, but the excel version I´m using for this work does not support new functionalities like choosecols. Sorry, I must have mentioned it while posting itself. That is why I´m trying to play around with filter function only or any other alternatives supported by excel versions previous to office 365.
 
Upvote 0
The filter function is only in 365 & 2021, so if you need it to work in older version you cannot use Filter.
 
Upvote 0

Forum statistics

Threads
1,223,885
Messages
6,175,179
Members
452,615
Latest member
bogeys2birdies

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