Sumproduct mmddyyy just the month?

W

wx4usa

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!
 
J

Joe User

wx4usa said:
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"),c1: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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top