Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Kim
 
Posts: n/a
Default SumProduct or CountIf

I am trying to implement the following function to count the number of
entries I have for January, February, etc.

=SUMPRODUCT(--(TEXT(SheetName!J5:J8,"mmmm")="January"))

It works fine for February, March, etc. but not for January because it reads
the empty cells as being 01/01/1901. Any suggestions? Thanks.
  #2   Report Post  
Roger Govier
 
Posts: n/a
Default


Hi Kim

Try
=SUMPRODUCT(--(TEXT(SheetName!J5:J8,"mmmm")="January")*(SheetNam e!J5:J8,<))

--
Regards
Roger Govier
"Kim" wrote in message
...
I am trying to implement the following function to count the number of
entries I have for January, February, etc.

=SUMPRODUCT(--(TEXT(SheetName!J5:J8,"mmmm")="January"))

It works fine for February, March, etc. but not for January because it
reads
the empty cells as being 01/01/1901. Any suggestions? Thanks.



  #3   Report Post  
Kim
 
Posts: n/a
Default

Thank you. I could not get this to work. Excel tells me my function
contains an error.

"Roger Govier" wrote:


Hi Kim

Try
=SUMPRODUCT(--(TEXT(SheetName!J5:J8,"mmmm")="January")*(SheetNam e!J5:J8,<))

--
Regards
Roger Govier
"Kim" wrote in message
...
I am trying to implement the following function to count the number of
entries I have for January, February, etc.

=SUMPRODUCT(--(TEXT(SheetName!J5:J8,"mmmm")="January"))

It works fine for February, March, etc. but not for January because it
reads
the empty cells as being 01/01/1901. Any suggestions? Thanks.




  #4   Report Post  
JE McGimpsey
 
Posts: n/a
Default

That gives me an error. Perhaps something like this, instead:

=SUMPRODUCT(--(MONTH(SheetName!J5:J8)=1),--(SheetName!J5:J8<""))


Note that if you're going to do the array multiplication first, using *,
there's no reason to use the double unary minuses (--). If you're going
to let SUMPRODUCT to the array multiplication by using the comma
notation, the double unary minuses are needed. The latter is slightly
more efficient.

In article ,
"Roger Govier" wrote:

Hi Kim

Try
=SUMPRODUCT(--(TEXT(SheetName!J5:J8,"mmmm")="January")*(SheetNam e!J5:J8,<))

  #5   Report Post  
JE McGimpsey
 
Posts: n/a
Default

Correction:

With multiple terms, one only need use at least one unary minus per
conditional, as long as the total number of unary minuses is even.

I find it's easier just to use double unary minuses for each conditional
all the time, if only to avoid thinking/explaining.


In article ,
JE McGimpsey wrote:

If you're going to let SUMPRODUCT to the array multiplication by
using the comma notation, the double unary minuses are needed. The
latter is slightly more efficient.



  #6   Report Post  
Kim
 
Posts: n/a
Default

Thank you. I got it to work.
=SUMPRODUCT(--(TEXT(SheetName!K4:K800, "mmmm")="January"),
--(Countrywide!K4:K800<0))


"JE McGimpsey" wrote:

That gives me an error. Perhaps something like this, instead:

=SUMPRODUCT(--(MONTH(SheetName!J5:J8)=1),--(SheetName!J5:J8<""))


Note that if you're going to do the array multiplication first, using *,
there's no reason to use the double unary minuses (--). If you're going
to let SUMPRODUCT to the array multiplication by using the comma
notation, the double unary minuses are needed. The latter is slightly
more efficient.

In article ,
"Roger Govier" wrote:

Hi Kim

Try
=SUMPRODUCT(--(TEXT(SheetName!J5:J8,"mmmm")="January")*(SheetNam e!J5:J8,<))


  #7   Report Post  
Dave Peterson
 
Posts: n/a
Default

You may want to add that --(SheetName!K4:K800<"") portion into your formula.

Try clearing the contents on sheetname!K4.

An empty cell will look like January when you do: =text(a1,"mmmm")

Kim wrote:

Thank you. I got it to work.
=SUMPRODUCT(--(TEXT(SheetName!K4:K800, "mmmm")="January"),
--(Countrywide!K4:K800<0))

"JE McGimpsey" wrote:

That gives me an error. Perhaps something like this, instead:

=SUMPRODUCT(--(MONTH(SheetName!J5:J8)=1),--(SheetName!J5:J8<""))


Note that if you're going to do the array multiplication first, using *,
there's no reason to use the double unary minuses (--). If you're going
to let SUMPRODUCT to the array multiplication by using the comma
notation, the double unary minuses are needed. The latter is slightly
more efficient.

In article ,
"Roger Govier" wrote:

Hi Kim

Try
=SUMPRODUCT(--(TEXT(SheetName!J5:J8,"mmmm")="January")*(SheetNam e!J5:J8,<))



--

Dave Peterson
  #8   Report Post  
KL
 
Posts: n/a
Default

JFYI: this formula won't work in any other version of the Office, but
English. If your application may be used internationally you're better off
using the formula proposed by JE McGimpsey

Regards,
KL

"Kim" wrote in message
...
Thank you. I got it to work.
=SUMPRODUCT(--(TEXT(SheetName!K4:K800, "mmmm")="January"),
--(Countrywide!K4:K800<0))


"JE McGimpsey" wrote:

That gives me an error. Perhaps something like this, instead:

=SUMPRODUCT(--(MONTH(SheetName!J5:J8)=1),--(SheetName!J5:J8<""))


Note that if you're going to do the array multiplication first, using *,
there's no reason to use the double unary minuses (--). If you're going
to let SUMPRODUCT to the array multiplication by using the comma
notation, the double unary minuses are needed. The latter is slightly
more efficient.

In article ,
"Roger Govier" wrote:

Hi Kim

Try
=SUMPRODUCT(--(TEXT(SheetName!J5:J8,"mmmm")="January")*(SheetNam e!J5:J8,<))




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
countif, sumproduct mg New Users to Excel 7 July 1st 05 10:26 PM
COUNTIF or SUMPRODUCT counting multiple criteria Kim Excel Worksheet Functions 1 June 1st 05 12:19 AM
COUNTIF or SUMPRODUCT counting multiple criteria Peo Sjoblom Excel Worksheet Functions 0 May 31st 05 11:40 PM
Using COUNTIF with 2 criteria - SUMPRODUCT? Mike R. Excel Worksheet Functions 2 February 24th 05 05:57 AM
SUMPRODUCT & COUNTIF Connie Martin Excel Worksheet Functions 2 December 16th 04 06:53 PM


All times are GMT +1. The time now is 12:31 PM.

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

About Us

"It's about Microsoft Excel"