ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Sumproduct mmddyyy just the month? (https://www.excelbanter.com/excel-discussion-misc-queries/252744-sumproduct-mmddyyy-just-month.html)

wx4usa

Sumproduct mmddyyy just the month?
 
I have the date in column A mmddyyy and I need a sumproduct formula
to deliver the sales for Mike in December. Salesperson is in B and
sales is in C. How to I extract the month from culom A in the
sumproduct formula??

Thanks all!

Don Guillett

Sumproduct mmddyyy just the month?
 
=sumproduct((month(a2:a22)=12)*(b2:b22="mike")*c2: c22)

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"wx4usa" wrote in message
...
I have the date in column A mmddyyy and I need a sumproduct formula
to deliver the sales for Mike in December. Salesperson is in B and
sales is in C. How to I extract the month from culom A in the
sumproduct formula??

Thanks all!



Joe User[_2_]

Sumproduct mmddyyy just the month?
 
"wx4usa" wrote:
I have the date in column A mmddyyy and I need
a sumproduct formula to deliver the sales for Mike
in December. Salesperson is in B and sales is in C.
How to I extract the month from culom A in the
sumproduct formula?


That depends on what you mean by mmddyyy [sic].

If you have a date (serial number) that is formatted as mmddyyyy, you can
simply do:

=sumproduct((month(a1:a100)=12)*(b1:b100="mike"),c 1:c100)

But if mmddyyyy is text, you might do:

=sumproduct((--left(a1:a100,2)=12)*(b1:b100="mike"),c1:c100)

On the other hand, if mmddyyyy is a number formatted as 00000000, the LEFT
expression above will not work for months less than 10, despite the format
to display the leading zero.

Instead, you might do:

=sumproduct((int(a1:a100/1000000)=12)*(b1:b100="mike"),c1:c100)



All times are GMT +1. The time now is 10:15 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com