#1   Report Post  
Posted to microsoft.public.excel.programming
FPJ FPJ is offline
external usenet poster
 
Posts: 19
Default sumproduct

I have a question:

I have a worksheet that in one column contains the dates of the reports were
generated and in another column text codes (example: 1-UCF, 1-DEL, 1-HOM,
1-PAS, 2-UCF, 2-DEL, 2-HOM, 2-PAS).

My question is, how do you write the formula if you want to count the number
of codes that have the prefix 1 that occured on January?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default sumproduct

=SUMPRODUCT(--(MONTH(A1:A100)=1),--(LEFT(B1:B100,1)="1"))

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"FPJ" wrote in message
...
I have a question:

I have a worksheet that in one column contains the dates of the reports

were
generated and in another column text codes (example: 1-UCF, 1-DEL, 1-HOM,
1-PAS, 2-UCF, 2-DEL, 2-HOM, 2-PAS).

My question is, how do you write the formula if you want to count the

number
of codes that have the prefix 1 that occured on January?



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default sumproduct

Empty cells will be treated as being in January, too.

=SUMPRODUCT(--(a1:a100<""),--(MONTH(A1:A100)=1),--(LEFT(B1:B100,1)="1"))

is one way to avoid that problem.

Bob Phillips wrote:

=SUMPRODUCT(--(MONTH(A1:A100)=1),--(LEFT(B1:B100,1)="1"))

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"FPJ" wrote in message
...
I have a question:

I have a worksheet that in one column contains the dates of the reports

were
generated and in another column text codes (example: 1-UCF, 1-DEL, 1-HOM,
1-PAS, 2-UCF, 2-DEL, 2-HOM, 2-PAS).

My question is, how do you write the formula if you want to count the

number
of codes that have the prefix 1 that occured on January?


--

Dave Peterson
  #4   Report Post  
Posted to microsoft.public.excel.programming
FPJ FPJ is offline
external usenet poster
 
Posts: 19
Default sumproduct

I tried both formula and they are giving me a #VALUE result. Does it have
anything to do with the formula being linked to another worksheet?

"Dave Peterson" wrote:

Empty cells will be treated as being in January, too.

=SUMPRODUCT(--(a1:a100<""),--(MONTH(A1:A100)=1),--(LEFT(B1:B100,1)="1"))

is one way to avoid that problem.

Bob Phillips wrote:

=SUMPRODUCT(--(MONTH(A1:A100)=1),--(LEFT(B1:B100,1)="1"))

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"FPJ" wrote in message
...
I have a question:

I have a worksheet that in one column contains the dates of the reports

were
generated and in another column text codes (example: 1-UCF, 1-DEL, 1-HOM,
1-PAS, 2-UCF, 2-DEL, 2-HOM, 2-PAS).

My question is, how do you write the formula if you want to count the

number
of codes that have the prefix 1 that occured on January?


--

Dave Peterson

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default sumproduct

#VALUE sounds as if the range in your formula are not the same size, they
must be.

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"FPJ" wrote in message
...
I tried both formula and they are giving me a #VALUE result. Does it have
anything to do with the formula being linked to another worksheet?

"Dave Peterson" wrote:

Empty cells will be treated as being in January, too.


=SUMPRODUCT(--(a1:a100<""),--(MONTH(A1:A100)=1),--(LEFT(B1:B100,1)="1"))

is one way to avoid that problem.

Bob Phillips wrote:

=SUMPRODUCT(--(MONTH(A1:A100)=1),--(LEFT(B1:B100,1)="1"))

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"FPJ" wrote in message
...
I have a question:

I have a worksheet that in one column contains the dates of the

reports
were
generated and in another column text codes (example: 1-UCF, 1-DEL,

1-HOM,
1-PAS, 2-UCF, 2-DEL, 2-HOM, 2-PAS).

My question is, how do you write the formula if you want to count

the
number
of codes that have the prefix 1 that occured on January?


--

Dave Peterson





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default sumproduct

Or maybe you have #value! errors in one of those ranges?

FPJ wrote:

I tried both formula and they are giving me a #VALUE result. Does it have
anything to do with the formula being linked to another worksheet?

"Dave Peterson" wrote:

Empty cells will be treated as being in January, too.

=SUMPRODUCT(--(a1:a100<""),--(MONTH(A1:A100)=1),--(LEFT(B1:B100,1)="1"))

is one way to avoid that problem.

Bob Phillips wrote:

=SUMPRODUCT(--(MONTH(A1:A100)=1),--(LEFT(B1:B100,1)="1"))

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"FPJ" wrote in message
...
I have a question:

I have a worksheet that in one column contains the dates of the reports
were
generated and in another column text codes (example: 1-UCF, 1-DEL, 1-HOM,
1-PAS, 2-UCF, 2-DEL, 2-HOM, 2-PAS).

My question is, how do you write the formula if you want to count the
number
of codes that have the prefix 1 that occured on January?


--

Dave Peterson


--

Dave Peterson
  #7   Report Post  
Posted to microsoft.public.excel.programming
FPJ FPJ is offline
external usenet poster
 
Posts: 19
Default sumproduct

What will be the formula if the B column also has an empty cells. I still get
the #VALUE. Thanks.

"Bob Phillips" wrote:

#VALUE sounds as if the range in your formula are not the same size, they
must be.

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"FPJ" wrote in message
...
I tried both formula and they are giving me a #VALUE result. Does it have
anything to do with the formula being linked to another worksheet?

"Dave Peterson" wrote:

Empty cells will be treated as being in January, too.


=SUMPRODUCT(--(a1:a100<""),--(MONTH(A1:A100)=1),--(LEFT(B1:B100,1)="1"))

is one way to avoid that problem.

Bob Phillips wrote:

=SUMPRODUCT(--(MONTH(A1:A100)=1),--(LEFT(B1:B100,1)="1"))

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"FPJ" wrote in message
...
I have a question:

I have a worksheet that in one column contains the dates of the

reports
were
generated and in another column text codes (example: 1-UCF, 1-DEL,

1-HOM,
1-PAS, 2-UCF, 2-DEL, 2-HOM, 2-PAS).

My question is, how do you write the formula if you want to count

the
number
of codes that have the prefix 1 that occured on January?

--

Dave Peterson




  #8   Report Post  
Posted to microsoft.public.excel.programming
FPJ FPJ is offline
external usenet poster
 
Posts: 19
Default sumproduct

Yes, 2 of the cells in the range have the word VOID instead of the date. And
I want to keep the word VOID in there. How will the formula look like? Thanks.

"Dave Peterson" wrote:

Or maybe you have #value! errors in one of those ranges?

FPJ wrote:

I tried both formula and they are giving me a #VALUE result. Does it have
anything to do with the formula being linked to another worksheet?

"Dave Peterson" wrote:

Empty cells will be treated as being in January, too.

=SUMPRODUCT(--(a1:a100<""),--(MONTH(A1:A100)=1),--(LEFT(B1:B100,1)="1"))

is one way to avoid that problem.

Bob Phillips wrote:

=SUMPRODUCT(--(MONTH(A1:A100)=1),--(LEFT(B1:B100,1)="1"))

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"FPJ" wrote in message
...
I have a question:

I have a worksheet that in one column contains the dates of the reports
were
generated and in another column text codes (example: 1-UCF, 1-DEL, 1-HOM,
1-PAS, 2-UCF, 2-DEL, 2-HOM, 2-PAS).

My question is, how do you write the formula if you want to count the
number
of codes that have the prefix 1 that occured on January?

--

Dave Peterson


--

Dave Peterson

  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default sumproduct

=SUMPRODUCT(--(a1:a100<""),--(MONTH(A1:A100)=1),--(LEFT(B1:B100,1)="1"))
becomes
=SUM(--(IF(ISNUMBER(A1:A100),MONTH(A1:A100))=1)*(LEFT(B1: B100,1)="1"))

This is an array formula. Hit ctrl-shift-enter instead of enter. If you do it
correctly, excel will wrap curly brackets {} around your formula. (don't type
them yourself.)

Adjust the range to match--but you can't use the whole column.

FPJ wrote:

Yes, 2 of the cells in the range have the word VOID instead of the date. And
I want to keep the word VOID in there. How will the formula look like? Thanks.

"Dave Peterson" wrote:

Or maybe you have #value! errors in one of those ranges?

FPJ wrote:

I tried both formula and they are giving me a #VALUE result. Does it have
anything to do with the formula being linked to another worksheet?

"Dave Peterson" wrote:

Empty cells will be treated as being in January, too.

=SUMPRODUCT(--(a1:a100<""),--(MONTH(A1:A100)=1),--(LEFT(B1:B100,1)="1"))

is one way to avoid that problem.

Bob Phillips wrote:

=SUMPRODUCT(--(MONTH(A1:A100)=1),--(LEFT(B1:B100,1)="1"))

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"FPJ" wrote in message
...
I have a question:

I have a worksheet that in one column contains the dates of the reports
were
generated and in another column text codes (example: 1-UCF, 1-DEL, 1-HOM,
1-PAS, 2-UCF, 2-DEL, 2-HOM, 2-PAS).

My question is, how do you write the formula if you want to count the
number
of codes that have the prefix 1 that occured on January?

--

Dave Peterson


--

Dave Peterson


--

Dave Peterson
  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default sumproduct

And you don't need the -- stuff:

=SUM((IF(ISNUMBER(A1:A100),MONTH(A1:A100))=1)*(LEF T(B1:B100,1)="1"))

Dave Peterson wrote:

=SUMPRODUCT(--(a1:a100<""),--(MONTH(A1:A100)=1),--(LEFT(B1:B100,1)="1"))
becomes
=SUM(--(IF(ISNUMBER(A1:A100),MONTH(A1:A100))=1)*(LEFT(B1: B100,1)="1"))

This is an array formula. Hit ctrl-shift-enter instead of enter. If you do it
correctly, excel will wrap curly brackets {} around your formula. (don't type
them yourself.)

Adjust the range to match--but you can't use the whole column.

FPJ wrote:

Yes, 2 of the cells in the range have the word VOID instead of the date. And
I want to keep the word VOID in there. How will the formula look like? Thanks.

"Dave Peterson" wrote:

Or maybe you have #value! errors in one of those ranges?

FPJ wrote:

I tried both formula and they are giving me a #VALUE result. Does it have
anything to do with the formula being linked to another worksheet?

"Dave Peterson" wrote:

Empty cells will be treated as being in January, too.

=SUMPRODUCT(--(a1:a100<""),--(MONTH(A1:A100)=1),--(LEFT(B1:B100,1)="1"))

is one way to avoid that problem.

Bob Phillips wrote:

=SUMPRODUCT(--(MONTH(A1:A100)=1),--(LEFT(B1:B100,1)="1"))

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"FPJ" wrote in message
...
I have a question:

I have a worksheet that in one column contains the dates of the reports
were
generated and in another column text codes (example: 1-UCF, 1-DEL, 1-HOM,
1-PAS, 2-UCF, 2-DEL, 2-HOM, 2-PAS).

My question is, how do you write the formula if you want to count the
number
of codes that have the prefix 1 that occured on January?

--

Dave Peterson


--

Dave Peterson


--

Dave Peterson


--

Dave Peterson


  #11   Report Post  
Posted to microsoft.public.excel.programming
FPJ FPJ is offline
external usenet poster
 
Posts: 19
Default sumproduct

IT WORKS!!!!!!! Thank you very much!!!! I just have one more question: What
does the number 1 in (LEFT(B1:B100,1) stands for?

"Dave Peterson" wrote:

And you don't need the -- stuff:

=SUM((IF(ISNUMBER(A1:A100),MONTH(A1:A100))=1)*(LEF T(B1:B100,1)="1"))

Dave Peterson wrote:

=SUMPRODUCT(--(a1:a100<""),--(MONTH(A1:A100)=1),--(LEFT(B1:B100,1)="1"))
becomes
=SUM(--(IF(ISNUMBER(A1:A100),MONTH(A1:A100))=1)*(LEFT(B1: B100,1)="1"))

This is an array formula. Hit ctrl-shift-enter instead of enter. If you do it
correctly, excel will wrap curly brackets {} around your formula. (don't type
them yourself.)

Adjust the range to match--but you can't use the whole column.

FPJ wrote:

Yes, 2 of the cells in the range have the word VOID instead of the date. And
I want to keep the word VOID in there. How will the formula look like? Thanks.

"Dave Peterson" wrote:

Or maybe you have #value! errors in one of those ranges?

FPJ wrote:

I tried both formula and they are giving me a #VALUE result. Does it have
anything to do with the formula being linked to another worksheet?

"Dave Peterson" wrote:

Empty cells will be treated as being in January, too.

=SUMPRODUCT(--(a1:a100<""),--(MONTH(A1:A100)=1),--(LEFT(B1:B100,1)="1"))

is one way to avoid that problem.

Bob Phillips wrote:

=SUMPRODUCT(--(MONTH(A1:A100)=1),--(LEFT(B1:B100,1)="1"))

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"FPJ" wrote in message
...
I have a question:

I have a worksheet that in one column contains the dates of the reports
were
generated and in another column text codes (example: 1-UCF, 1-DEL, 1-HOM,
1-PAS, 2-UCF, 2-DEL, 2-HOM, 2-PAS).

My question is, how do you write the formula if you want to count the
number
of codes that have the prefix 1 that occured on January?

--

Dave Peterson


--

Dave Peterson


--

Dave Peterson


--

Dave Peterson

  #12   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default sumproduct

=left(a1,14)
will return the leftmost 14 characters.

=left(a1,1)
will return the leftmost character.

If you don't put a number in that second argument, excel will know that you want
just 1 character. But I like being explicit.

FPJ wrote:

IT WORKS!!!!!!! Thank you very much!!!! I just have one more question: What
does the number 1 in (LEFT(B1:B100,1) stands for?

"Dave Peterson" wrote:

And you don't need the -- stuff:

=SUM((IF(ISNUMBER(A1:A100),MONTH(A1:A100))=1)*(LEF T(B1:B100,1)="1"))

Dave Peterson wrote:

=SUMPRODUCT(--(a1:a100<""),--(MONTH(A1:A100)=1),--(LEFT(B1:B100,1)="1"))
becomes
=SUM(--(IF(ISNUMBER(A1:A100),MONTH(A1:A100))=1)*(LEFT(B1: B100,1)="1"))

This is an array formula. Hit ctrl-shift-enter instead of enter. If you do it
correctly, excel will wrap curly brackets {} around your formula. (don't type
them yourself.)

Adjust the range to match--but you can't use the whole column.

FPJ wrote:

Yes, 2 of the cells in the range have the word VOID instead of the date. And
I want to keep the word VOID in there. How will the formula look like? Thanks.

"Dave Peterson" wrote:

Or maybe you have #value! errors in one of those ranges?

FPJ wrote:

I tried both formula and they are giving me a #VALUE result. Does it have
anything to do with the formula being linked to another worksheet?

"Dave Peterson" wrote:

Empty cells will be treated as being in January, too.

=SUMPRODUCT(--(a1:a100<""),--(MONTH(A1:A100)=1),--(LEFT(B1:B100,1)="1"))

is one way to avoid that problem.

Bob Phillips wrote:

=SUMPRODUCT(--(MONTH(A1:A100)=1),--(LEFT(B1:B100,1)="1"))

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"FPJ" wrote in message
...
I have a question:

I have a worksheet that in one column contains the dates of the reports
were
generated and in another column text codes (example: 1-UCF, 1-DEL, 1-HOM,
1-PAS, 2-UCF, 2-DEL, 2-HOM, 2-PAS).

My question is, how do you write the formula if you want to count the
number
of codes that have the prefix 1 that occured on January?

--

Dave Peterson


--

Dave Peterson


--

Dave Peterson


--

Dave Peterson


--

Dave Peterson
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Sumproduct with Condition OR Sumproduct with ADDRESS function - HE gholly Excel Discussion (Misc queries) 2 September 28th 09 05:07 PM
Conditional SUMPRODUCT or SUMPRODUCT with Filters Ted M H Excel Worksheet Functions 4 August 14th 08 07:50 PM
sumproduct? sumif(sumproduct)? David Excel Worksheet Functions 3 July 13th 07 07:06 PM
SUMPRODUCT Mark Allen Excel Discussion (Misc queries) 8 June 2nd 07 09:56 PM
Sumproduct Q Sean Excel Worksheet Functions 4 April 26th 07 08:34 PM


All times are GMT +1. The time now is 06:49 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"