need a 'ProductIf' solution

FrankExcel

New Member
Joined
Feb 21, 2009
Messages
28
don't know why excel didn't do productIF just like it did for sumIF...

if I have dates and use the eomonth() function to grab the end of date like this

7/31/09 7/23/09
7/31/09 7/22/09
7/31/09 7/21/09
6/30/09 6/29/09
6/30/09 6/28/09
6/30/09 6/27/09
etc...


now I want to do the product of all the numbers in the next column over for the month of July.

if this were 'sumif' -- it would be sumif(range, criteria, [range to sum])

what I would like is productif(range, criteria, [range to calculate product])

is there an easy way to do this in a single cell?
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
If you have dates covering more than one year, then you may need a bit more, but SUMPRODUCT is the function you are after.

Note that you could do this without the end of month formula if you want - just use column B in my formula instead of column A.

Excel Workbook
ABCDE
131/07/200916
231/07/20092
331/07/20093
430/06/20094
530/06/20095
630/06/20096
7
SUMPRODUCT
 
Upvote 0
why sumproduct?
Because I mis-read your requirement.


just

=PRODUCT(--(MONTH(K22:K37)=7),(M22:M37))
Unless I'm still mis-interpreting, that doesn't do it either - see cell P22 below.

If you want to multiply the values in column M for the rows where the month in column K is July, then try the formula in O22. Note that it is an array formula so should be entered without the {} but confirmed with Ctrl+shift+Enter which will enclose the formula in {} as shown.

If this is not what you want, please explain what the correct solution for this sample data should be, and why.

Excel Workbook
KLMNOP
2231/07/20092245040
2331/07/20093
2431/07/20094
2530/06/20095
2630/06/20096
2730/06/20097
28
PRODUCT
 
Last edited:
Upvote 0
thank you, the formula in 022 is exactly what I needed... I learned something that will save a lot of time and I appreciate it.
 
Upvote 0

Forum statistics

Threads
1,215,221
Messages
6,123,699
Members
449,117
Latest member
Aaagu

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