SUMPRODUCT where a condition is date falls in month prior to current month

Aimee S.

Board Regular
Joined
Sep 28, 2010
Messages
236
Office Version
  1. 365
Platform
  1. Windows
Special thanks to T. Valko for helping me with my prior thread.

I need to take his advice a step further.

This is the formula he provided (updated to meet my specific needs):

=SUMPRODUCT(--('3-FactoryCalculation'!$L$3:'3-FactoryCalculation'!$L$5000=1),--('3-FactoryCalculation'!$C$3:'3-FactoryCalculation'!$C$5000="Base"),--(TEXT('3-FactoryCalculation'!$R$3:'3-FactoryCalculation'!$R$5000,"mmmyyyy")=TEXT(NOW(),"mmmyyyy")))

It only counts projects on Sheet 'FactoryCalculation' if:
Column L has value of 1
Column C has value "Base"
Column R has a date which falls within the present calendar month, whatever month that may be.



Is it possible to use this sort of formula to only count projects in that same sheet where:
Column L has value of 1
Column C has value of "Base"
and Column R has a date which falls within the PREVIOUS month, i.e. the month that is always just prior to the present calendar month


This is required so that every month when we have our monthly Operations Review, we can easily look at all data for the entirey of the previous month.
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
Special thanks to T. Valko for helping me with my prior thread.

I need to take his advice a step further.

This is the formula he provided (updated to meet my specific needs):

=SUMPRODUCT(--('3-FactoryCalculation'!$L$3:'3-FactoryCalculation'!$L$5000=1),--('3-FactoryCalculation'!$C$3:'3-FactoryCalculation'!$C$5000="Base"),--(TEXT('3-FactoryCalculation'!$R$3:'3-FactoryCalculation'!$R$5000,"mmmyyyy")=TEXT(NOW(),"mmmyyyy")))

It only counts projects on Sheet 'FactoryCalculation' if:
Column L has value of 1
Column C has value "Base"
Column R has a date which falls within the present calendar month, whatever month that may be.



Is it possible to use this sort of formula to only count projects in that same sheet where:
Column L has value of 1
Column C has value of "Base"
and Column R has a date which falls within the PREVIOUS month, i.e. the month that is always just prior to the present calendar month


This is required so that every month when we have our monthly Operations Review, we can easily look at all data for the entirey of the previous month.

Try...

A1: 1
B1: Base
C1:
Rich (BB code):
=EOMONTH(TODAY(),-2)+1

D1:
Rich (BB code):
=SUMPRODUCT(
    --('3-FactoryCalculation'!$L$3:$L$5000=A1),
    --('3-FactoryCalculation'!$C$3:$C$5000=B1),
    --('3-FactoryCalculation'!$R$3:$R$5000-DAY('3-FactoryCalculation'!$R$3:$R$5000)+1=C1))
 
Upvote 0
this type of construct

Excel Workbook
GHI
133base15/02/2011
141base02/03/2011
153Bottom05/02/2011
162Bottom13/02/2011
171Bottom17/03/2011
181Top24/03/2011
191Top19/02/2011
203Top11/02/2011
211Bottom09/03/2011
222Top12/02/2011
231base16/03/2011
243base31/03/2011
253base17/02/2011
263base03/04/2011
273Top18/03/2011
283Top11/02/2011
293Top01/04/2011
30
312
Pivot Table
 
Upvote 0
Special thanks to T. Valko for helping me with my prior thread.

I need to take his advice a step further.

This is the formula he provided (updated to meet my specific needs):

=SUMPRODUCT(--('3-FactoryCalculation'!$L$3:'3-FactoryCalculation'!$L$5000=1),--('3-FactoryCalculation'!$C$3:'3-FactoryCalculation'!$C$5000="Base"),--(TEXT('3-FactoryCalculation'!$R$3:'3-FactoryCalculation'!$R$5000,"mmmyyyy")=TEXT(NOW(),"mmmyyyy")))

It only counts projects on Sheet 'FactoryCalculation' if:
Column L has value of 1
Column C has value "Base"
Column R has a date which falls within the present calendar month, whatever month that may be.



Is it possible to use this sort of formula to only count projects in that same sheet where:
Column L has value of 1
Column C has value of "Base"
and Column R has a date which falls within the PREVIOUS month, i.e. the month that is always just prior to the present calendar month


This is required so that every month when we have our monthly Operations Review, we can easily look at all data for the entirey of the previous month.
For the previous month replace this:

TEXT(NOW(),"mmmyyyy")

With:

TEXT(NOW()-DAY(NOW()),"mmmyyyy")
 
Upvote 0
Yes, in C1 I did paste the formula as written :(

Valko: Your formula amendment worked perfect but Excel caught that there needed to be ))) at the end not just one ).

With the extra 2 parentheses at the end it works perfect (I verfied by auto filtering manually for that same data and received the same count, 29).

Thanks everyone for your collective help on this one! ;) If I were as smart as any of you, I'd be a richer woman hehe
 
Upvote 0
Valko: Your formula amendment worked perfect but Excel caught that there needed to be ))) at the end not just one ).

With the extra 2 parentheses at the end it works perfect (I verfied by auto filtering manually for that same data and received the same count, 29).

Thanks everyone for your collective help on this one! ;) If I were as smart as any of you, I'd be a richer woman hehe
Those closing ) were needed to complete the entire formula. My suggestion was just a change in a specific portion of the formula.

In any case, glad it worked for you. Thanks for the feedback! :cool:
 
Upvote 0
Ahhhh. I am too much of a nub to have realized that is what you meant and just pasted the thing over without thinking that part through haha. Live and learn!!!!
 
Upvote 0

Forum statistics

Threads
1,224,564
Messages
6,179,543
Members
452,924
Latest member
JackiG

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