Multiple criteria one range using SUMIFS, EOMONTH and blank cells

jayped

Board Regular
Joined
Mar 20, 2019
Messages
52
Hi, I am seeking help on a formula which allows me to sum a column based on multiple criteria. The formula I am currently using is as follows:

SUM(SUMIFS(Data!F:F,Data!J:J,">"&EOMONTH($B$5,-1),Data!A:A,"<"&EOMONTH($B$5,-1)+1,Data!$B:$B,"W"))

The first criteria (in bold) is the portion I am having the most difficulty with. I would like to perform a sum of data in column F in the Data tab based on two criteria for the dates in Column J in the Data tab; 1) if the date is greater than the last day of the previous month (hence eomonth function) and 2) if any cells are blank.

I have tried using curly brackets {">"&EOMONTH(B5,-1),""} but to no success. I cannot find anything that helps.



Regards
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
56,614
Office Version
  1. 365
Platform
  1. Windows
Based on your description, how about
=SUMIFS(Data!F:F,Data!J:J,">"&EOMONTH(B5,-1))
 

jayped

Board Regular
Joined
Mar 20, 2019
Messages
52
What if a date hasn't been entered and the cell is left blank. I'd like the corresponding F row to be included in the sum total as well.
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
56,614
Office Version
  1. 365
Platform
  1. Windows
In that case try
=SUMPRODUCT((Data!J3:J19>EOMONTH(B5,-1))+(Data!J3:J19=""),Data!F3:F19)
 

jayped

Board Regular
Joined
Mar 20, 2019
Messages
52

ADVERTISEMENT

Thank you. It has worked so far. However, I need another criteria in the formula - that is Data!B3:19="W". How can I incorporate this into the formula? What I have below isn't working. It's including the amount where DataJ3:J19="" whether there is a W or not in column B.

SUMPRODUCT((Data!$B$5:$B$212="W")*(Data!$A$5:$A$212<eomonth($b$5,-1))*(data!$j$5:$j$212>EOMONTH($B$5,-1))+(Data!$J$5:$J$212=""),Data!$F$5:$F$212)

Thanks.
 
Last edited by a moderator:

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
56,614
Office Version
  1. 365
Platform
  1. Windows
How about
=SUMPRODUCT((Data!$B$5:$B$212="W")*(Data!$A$5:$A$212< EOMONTH($B$5,-1))*((Data!$J$5:$J$212>EOMONTH($B$5,-1))+(Data!$J$5:$J$212="")),Data!$F$5:$F$212)
 
Last edited:

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
56,614
Office Version
  1. 365
Platform
  1. Windows
You're welcome & thanks for the feedback
 

Watch MrExcel Video

Forum statistics

Threads
1,129,677
Messages
5,637,735
Members
416,981
Latest member
PLonchar

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
Top