Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5
Default Counting Occurances across a range of sheets

I have a number of identical sheets, and I'd like to be able to count
the occurances of a certain entry in a cell.

When I use the formula:

=COUNTIF('Sheet1:Sheet16'!H2, "W")

the cell displays ##### (error in value).

What's a formula I can use?

Also, I'd like to be able to do a similar thing, with non-blank values
(i.e. I'd like to count the number of non-blank cells across a number
of identical sheets).

Thanks in advance for your help.

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default Counting Occurances across a range of sheets

Try these:

=SUMPRODUCT(COUNTIF(INDIRECT("Sheet"&ROW(INDIRECT( "1:16"))&"!H2"),"W"))

=SUMPRODUCT(COUNTIF(INDIRECT("Sheet"&ROW(INDIRECT( "1:16"))&"!H2"),"<"))

Biff

wrote in message
oups.com...
I have a number of identical sheets, and I'd like to be able to count
the occurances of a certain entry in a cell.

When I use the formula:

=COUNTIF('Sheet1:Sheet16'!H2, "W")

the cell displays ##### (error in value).

What's a formula I can use?

Also, I'd like to be able to do a similar thing, with non-blank values
(i.e. I'd like to count the number of non-blank cells across a number
of identical sheets).

Thanks in advance for your help.



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5
Default Counting Occurances across a range of sheets

Hmmm, I tried those formulae, but I get an invalid cell reference
error after substituting in the respective sheet names.

If I use

=SUMPRODUCT(COUNTIF(INDIRECT('Sheet 1'!H2&ROW(INDIRECT("1:16"))&"!
H2"),"W"))

the cell displays the correct number of W's, but obviously I want to
count across a number of sheets.

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 150
Default Counting Occurances across a range of sheets

If your sheets are named Sheet1 through Sheet16, as per your original
post, there's no need to change Biff's formula.

In article .com,
wrote:

Hmmm, I tried those formulae, but I get an invalid cell reference
error after substituting in the respective sheet names.

If I use

=SUMPRODUCT(COUNTIF(INDIRECT('Sheet 1'!H2&ROW(INDIRECT("1:16"))&"!
H2"),"W"))

the cell displays the correct number of W's, but obviously I want to
count across a number of sheets.

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default Counting Occurances across a range of sheets

You don't need to change the sheet definition.

The sheet names are "built" within the formula by the first Indirect
function. It creates an array of references like this:

COUNTIF(Sheet1!,H2)
COUNTIF(Sheet2!,H2)
COUNTIF(Sheet3!,H2)
COUNTIF(Sheet4!,H2)
...
COUNTIF(Sheet16!,H2)

Then, Sumproduct adds up all the results.

If your sheet names are not the default names like, Sheet1, Sheet2, Sheet3,
etc., then we can tweak the formula. Post back if that's the case.

Biff

"T. Valko" wrote in message
...
Try these:

=SUMPRODUCT(COUNTIF(INDIRECT("Sheet"&ROW(INDIRECT( "1:16"))&"!H2"),"W"))

=SUMPRODUCT(COUNTIF(INDIRECT("Sheet"&ROW(INDIRECT( "1:16"))&"!H2"),"<"))

Biff

wrote in message
oups.com...
I have a number of identical sheets, and I'd like to be able to count
the occurances of a certain entry in a cell.

When I use the formula:

=COUNTIF('Sheet1:Sheet16'!H2, "W")

the cell displays ##### (error in value).

What's a formula I can use?

Also, I'd like to be able to do a similar thing, with non-blank values
(i.e. I'd like to count the number of non-blank cells across a number
of identical sheets).

Thanks in advance for your help.







  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default Counting Occurances across a range of sheets

The sheet names are "built" within the formula by the first Indirect
function. It creates an array of references like this:

COUNTIF(Sheet1!,H2)
COUNTIF(Sheet2!,H2)
COUNTIF(Sheet3!,H2)
COUNTIF(Sheet4!,H2)
..
COUNTIF(Sheet16!,H2)



Actually, that array of references would look like this:

COUNTIF(Sheet1!H2,"W")
COUNTIF(Sheet2!H2,"W")
COUNTIF(Sheet3!H2,"W")
etc
etc

Biff

"T. Valko" wrote in message
...
You don't need to change the sheet definition.

The sheet names are "built" within the formula by the first Indirect
function. It creates an array of references like this:

COUNTIF(Sheet1!,H2)
COUNTIF(Sheet2!,H2)
COUNTIF(Sheet3!,H2)
COUNTIF(Sheet4!,H2)
..
COUNTIF(Sheet16!,H2)

Then, Sumproduct adds up all the results.

If your sheet names are not the default names like, Sheet1, Sheet2,
Sheet3, etc., then we can tweak the formula. Post back if that's the case.

Biff

"T. Valko" wrote in message
...
Try these:

=SUMPRODUCT(COUNTIF(INDIRECT("Sheet"&ROW(INDIRECT( "1:16"))&"!H2"),"W"))

=SUMPRODUCT(COUNTIF(INDIRECT("Sheet"&ROW(INDIRECT( "1:16"))&"!H2"),"<"))

Biff

wrote in message
oups.com...
I have a number of identical sheets, and I'd like to be able to count
the occurances of a certain entry in a cell.

When I use the formula:

=COUNTIF('Sheet1:Sheet16'!H2, "W")

the cell displays ##### (error in value).

What's a formula I can use?

Also, I'd like to be able to do a similar thing, with non-blank values
(i.e. I'd like to count the number of non-blank cells across a number
of identical sheets).

Thanks in advance for your help.







  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5
Default Counting Occurances across a range of sheets

That's awesome guys, it works perfectly now.

Thanks for all your help!

GB.

  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default Counting Occurances across a range of sheets

You're welcome. Thanks for the feedback!

Biff

wrote in message
ps.com...
That's awesome guys, it works perfectly now.

Thanks for all your help!

GB.



  #9   Report Post  
Member
 
Posts: 89
Post

Quote:
Originally Posted by T. Valko View Post
You're welcome. Thanks for the feedback!

Biff

wrote in message
ps.com...
That's awesome guys, it works perfectly now.

Thanks for all your help!

GB.
What if someone wanted to add the values that match the criteria found? I.E. for every time X was found in column A and Y was beside it in Column B, then add the value (Also adjacent to them in the same row) in Column D. Is this possible? And not counting the occurences, just the value in Column D all the way down the sheet.
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 each time text appears in range??? Simon Lloyd Excel Worksheet Functions 1 June 9th 06 01:47 PM
Common range name for 2 sheets David Excel Discussion (Misc queries) 6 January 24th 06 03:26 PM
Match function...random search? Les Excel Worksheet Functions 10 July 28th 05 11:54 AM
count date occurances in range of dates... Alex Excel Worksheet Functions 2 July 27th 05 04:15 PM
Counting within a filtered range Jeff Excel Worksheet Functions 2 June 13th 05 03:33 AM


All times are GMT +1. The time now is 01:26 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"