=SUMPRODUCT Current Month Condition Help

Aimee S.

Board Regular
Joined
Sep 28, 2010
Messages
236
Office Version
  1. 365
Platform
  1. Windows
This currently works for one of my needs which is to say it counts if there is a value of 1 in column L, the word "Base" in column C, and the date present in column R falls between 3/1/11 and 3/31/11:

=SUMPRODUCT(--(L3:L5000=1),--(C3:C5000="Base"),--(R3:R5000>=DATE(2011,3,1)),--(R3:R5000<=DATE(2011,3,31)))

The second and more pressing of my needs is to have this same formula, but have these three conditions for SUMPRODUCT to count:

L3:L5000=1
C3:C5000="Base"

and the third condition, which is the one I am stuck on, should show R3:R5000 must fall within the current month, whatever that may be as time goes on.
Meaning, greater than or equal to the current month's 1st day, and less than or equal to the current month's last day.

:eeek::warning:

Please help!
 

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).
This currently works for one of my needs which is to say it counts if there is a value of 1 in column L, the word "Base" in column C, and the date present in column R falls between 3/1/11 and 3/31/11:

=SUMPRODUCT(--(L3:L5000=1),--(C3:C5000="Base"),--(R3:R5000>=DATE(2011,3,1)),--(R3:R5000<=DATE(2011,3,31)))

The second and more pressing of my needs is to have this same formula, but have these three conditions for SUMPRODUCT to count:

L3:L5000=1
C3:C5000="Base"

and the third condition, which is the one I am stuck on, should show R3:R5000 must fall within the current month, whatever that may be as time goes on.
Meaning, greater than or equal to the current month's 1st day, and less than or equal to the current month's last day.

:eeek::warning:

Please help!
Assuming that you want the current month AND the current year.

One way...

=SUMPRODUCT(--(L3:L5000=1),--(C3:C5000="Base"),--(TEXT(R3:R5000,"mmmyyyy")=TEXT(NOW(),"mmmyyyy")))
 
Upvote 0
Replace the hard-coded month in the formula with MONTH(TODAY()).
 
Upvote 0
Awesome thanks!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!:biggrin:
 
Upvote 0

Forum statistics

Threads
1,224,505
Messages
6,179,152
Members
452,891
Latest member
JUSTOUTOFMYREACH

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