Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
stumped
 
Posts: n/a
Default Counting in arrays

After reading a lot of answers in this group I am still stuck with
this one.

I have 4 excel columns thus:-

date initials date initial

03/01/2004 JK 05/02/2001 jw
23/05/2004 AP 12/12/2004 aw
I wish to count cells where the month and the year and the initials
are set conditions.

eg Count all JKs in january 2004
I can count on the first 2 columns with

{=SUM(IF(MONTH('2004'!$P$3:$P$998)=1,IF(YEAR('2004 '!$P$3:$P$998)=2004,IF('2004'!$R$3:$R$998="jk",1,0 ))))}

but cannot work out how to include next 2 columns.
The layout of the spreadsheet cannot be changed.
Go easy on me as I'm a pensioner trying to help a grand daughter
  #2   Report Post  
Frank Kabel
 
Posts: n/a
Default

Hi
try:
=SUMPRODUCT(--(MONTH('2004'!$P$3:$P$998)=1),--(YEAR('2004'!$P$3:$P$998)=2004),--('2004'!$R$3:$R$998="jk"))+SUMPRODUCT(--(MONTH('2004'!$S$3:$S$998)=1),--(YEAR('2004'!$S$3:$S$998)=2004),--('2004'!$T$3:$T$998="jk"))

"stumped" wrote:

After reading a lot of answers in this group I am still stuck with
this one.

I have 4 excel columns thus:-

date initials date initial

03/01/2004 JK 05/02/2001 jw
23/05/2004 AP 12/12/2004 aw
I wish to count cells where the month and the year and the initials
are set conditions.

eg Count all JKs in january 2004
I can count on the first 2 columns with

{=SUM(IF(MONTH('2004'!$P$3:$P$998)=1,IF(YEAR('2004 '!$P$3:$P$998)=2004,IF('2004'!$R$3:$R$998="jk",1,0 ))))}

but cannot work out how to include next 2 columns.
The layout of the spreadsheet cannot be changed.
Go easy on me as I'm a pensioner trying to help a grand daughter

  #3   Report Post  
Domenic
 
Posts: n/a
Default


Also...assuming that Columns A through D contain your data...

=SUM((IF(ISNUMBER(A1:C10),(MONTH(A1:C10)=1)*(YEAR( A1:C10)=2004)*(B1:D10="JK"))))

...entered using CONTROL+SHIFT+ENTER.

Hope this helsp!

stumped Wrote:
After reading a lot of answers in this group I am still stuck with
this one.

I have 4 excel columns thus:-

date initials date initial

03/01/2004 JK 05/02/2001 jw
23/05/2004 AP 12/12/2004 aw
I wish to count cells where the month and the year and the initials
are set conditions.

eg Count all JKs in january 2004
I can count on the first 2 columns with

{=SUM(IF(MONTH('2004'!$P$3:$P$998)=1,IF(YEAR('2004 '!$P$3:$P$998)=2004,IF('2004'!$R$3:$R$998="jk",1,0 ))))}

but cannot work out how to include next 2 columns.
The layout of the spreadsheet cannot be changed.
Go easy on me as I'm a pensioner trying to help a grand daughter



--
Domenic
------------------------------------------------------------------------
Domenic's Profile: http://www.excelforum.com/member.php...o&userid=10785
View this thread: http://www.excelforum.com/showthread...hreadid=277681

  #4   Report Post  
Jazzer
 
Posts: n/a
Default


Hi,

=SUM(('2004'!$R$3:$R$998='jk')*(MONTH('2004'!$P$3: $P$998)=1)*(YEAR('2004'!$P$3:$P$998)=2004)+('2004' !$T$3:$T$998='jk')*(MONTH('2004'!$S$3:$S$998)=1)*( YEAR('2004'!$S$3:$S$998)=2004))

- Asser


--
Jazzer
------------------------------------------------------------------------
Jazzer's Profile: http://www.excelforum.com/member.php...fo&userid=4464
View this thread: http://www.excelforum.com/showthread...hreadid=277681

  #5   Report Post  
jocker
 
Posts: n/a
Default

Excellent, what would I do without geniuses like you. Out of interest what
does the -- do in a function .
I could find no reference to it in help


+++++++++++++++++++
"Frank Kabel" wrote in message
...
Hi
try:
=SUMPRODUCT(--(MONTH('2004'!$P$3:$P$998)=1),--(YEAR('2004'!$P$3:$P$998)=2004),--('2004'!$R$3:$R$998="jk"))+SUMPRODUCT(--(MONTH('2004'!$S$3:$S$998)=1),--(YEAR('2004'!$S$3:$S$998)=2004),--('2004'!$T$3:$T$998="jk"))

"stumped" wrote:

After reading a lot of answers in this group I am still stuck with
this one.

I have 4 excel columns thus:-

date initials date initial

03/01/2004 JK 05/02/2001 jw
23/05/2004 AP 12/12/2004 aw
I wish to count cells where the month and the year and the initials
are set conditions.

eg Count all JKs in january 2004
I can count on the first 2 columns with

{=SUM(IF(MONTH('2004'!$P$3:$P$998)=1,IF(YEAR('2004 '!$P$3:$P$998)=2004,IF('2004'!$R$3:$R$998="jk",1,0 ))))}

but cannot work out how to include next 2 columns.
The layout of the spreadsheet cannot be changed.
Go easy on me as I'm a pensioner trying to help a grand daughter





  #6   Report Post  
Frank Kabel
 
Posts: n/a
Default

Hi
'--' coerces the bolean values (TRUE/FALSE) to real numbers (1/0)

See for more details about this:
http://www.xldynamic.com/source/xld.SUMPRODUCT.html
and
http://www.mcgimpsey.com/excel/formulae/doubleneg.html

--
Regards
Frank Kabel
Frankfurt, Germany

"jocker" schrieb im Newsbeitrag
i.nl...
Excellent, what would I do without geniuses like you. Out of interest

what
does the -- do in a function .
I could find no reference to it in help


+++++++++++++++++++
"Frank Kabel" wrote in message
...
Hi
try:

=SUMPRODUCT(--(MONTH('2004'!$P$3:$P$998)=1),--(YEAR('2004'!$P$3:$P$998)
=2004),--('2004'!$R$3:$R$998="jk"))+SUMPRODUCT(--(MONTH('2004'!$S$3:$S$
998)=1),--(YEAR('2004'!$S$3:$S$998)=2004),--('2004'!$T$3:$T$998="jk"))

"stumped" wrote:

After reading a lot of answers in this group I am still stuck with
this one.

I have 4 excel columns thus:-

date initials date initial

03/01/2004 JK 05/02/2001 jw
23/05/2004 AP 12/12/2004 aw
I wish to count cells where the month and the year and the

initials
are set conditions.

eg Count all JKs in january 2004
I can count on the first 2 columns with


{=SUM(IF(MONTH('2004'!$P$3:$P$998)=1,IF(YEAR('2004 '!$P$3:$P$998)=2004,I
F('2004'!$R$3:$R$998="jk",1,0))))}

but cannot work out how to include next 2 columns.
The layout of the spreadsheet cannot be changed.
Go easy on me as I'm a pensioner trying to help a grand daughter




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
Counting Rainfall Data TightIsobars Excel Discussion (Misc queries) 2 January 17th 05 11:45 PM
Counting question sjs Excel Discussion (Misc queries) 5 December 2nd 04 09:24 AM
Counting Function Dilemma Simon Lloyd Excel Worksheet Functions 0 November 8th 04 03:13 PM
counting entries between two dates? Todd Excel Worksheet Functions 7 November 1st 04 11:07 PM
counting simonkf Excel Worksheet Functions 7 October 30th 04 09:33 PM


All times are GMT +1. The time now is 12:24 AM.

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"