Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4
Default Count Text within Multiple Worksheets

I have a workbook with several sheets. I am trying to determine how many
times "x" appears - using a specific cell (A5) as my reference in each of
the sheets. I want to count how many times "x" appears in cell A5 within all
the worksheets and summarize on a summary worksheet. So, if I have 9
worksheets that I want to count, I want to know that "x" appears in only 7 of
the worksheets.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,058
Default Count Text within Multiple Worksheets

Try this UDF:


Function laffin()
Application.Volatile
laffin = 0
For i = 1 To Sheets.Count
If Sheets(i).Name = "summary" Then
Else
If Sheets(i).Range("A5").Value = "x" Then
laffin = laffin + 1
End If
End If
Next
End Function
--
Gary''s Student - gsnu200715
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,231
Default Count Text within Multiple Worksheets

Gary''s Student wrote...
Try this UDF:

Function laffin()

....

No arguments - usually a bad sign.

For i = 1 To Sheets.Count
If Sheets(i).Name = "summary" Then


Next bad sign - using hardcoded worksheet names.

Else
If Sheets(i).Range("A5").Value = "x" Then

....

Next bad sign - using hardcoded cell references.

There are better ways to write such a udf, and there are already
several dozen in the newsgroup archive, so I won't add another.

But udfs are slow. How about an .XLL add-in? Specifically, Laurent
Longre's MOREFUNC.XLL add-in, available at

http://xcell05.free.fr/english/

Once it's installed try

=SUMPRODUCT(--(THREED(alpha:omega!A5)="x"))

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,718
Default Count Text within Multiple Worksheets

=SUM(COUNTIF(INDIRECT("Sheet"&ROW(INDIRECT("1:9")) &"!A5"),"x"))

ctrl+shift+enter, not just enter


"Laffin" wrote:

I have a workbook with several sheets. I am trying to determine how many
times "x" appears - using a specific cell (A5) as my reference in each of
the sheets. I want to count how many times "x" appears in cell A5 within all
the worksheets and summarize on a summary worksheet. So, if I have 9
worksheets that I want to count, I want to know that "x" appears in only 7 of
the worksheets.

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,268
Default Count Text within Multiple Worksheets

Are the sheets named like name1. name2 and so on? If so use

=SUMPRODUCT(COUNTIF(INDIRECT("'Name"&{1;2;3;4;5;6; 7;8;9}&"'!A5"),"x"))

replace Name with whatever name you use for the sheets

however if each name is not in a patter like the above the easiest way is
to put all sheets name in a range, for instance if you put then in H1:H9 in
the summary sheet,

then you can use

=SUMPRODUCT(COUNTIF(INDIRECT("'"&H1:H9&"'!A5"),"x" ))


or select H1:H9, do insertnamedefine and give it a name like
MySheets, then you can use


=SUMPRODUCT(COUNTIF(INDIRECT("'"&MySheets&"'!A5"), "x"))


--
Regards,

Peo Sjoblom



"Laffin" wrote in message
...
I have a workbook with several sheets. I am trying to determine how many
times "x" appears - using a specific cell (A5) as my reference in each of
the sheets. I want to count how many times "x" appears in cell A5 within
all
the worksheets and summarize on a summary worksheet. So, if I have 9
worksheets that I want to count, I want to know that "x" appears in only 7
of
the worksheets.





  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4
Default Count Text within Multiple Worksheets

Your recommendation of putting the sheet names in a range of cells worked for
me. Thank you so much for that. However, since most of my sheets will not
likely have a pattern, if I only had two sheets I wanted to use and the names
were 43-03951804 and 80-06069282, how would I write the formula without
putting them in a range?

"Peo Sjoblom" wrote:

Are the sheets named like name1. name2 and so on? If so use

=SUMPRODUCT(COUNTIF(INDIRECT("'Name"&{1;2;3;4;5;6; 7;8;9}&"'!A5"),"x"))

replace Name with whatever name you use for the sheets

however if each name is not in a patter like the above the easiest way is
to put all sheets name in a range, for instance if you put then in H1:H9 in
the summary sheet,

then you can use

=SUMPRODUCT(COUNTIF(INDIRECT("'"&H1:H9&"'!A5"),"x" ))


or select H1:H9, do insertnamedefine and give it a name like
MySheets, then you can use


=SUMPRODUCT(COUNTIF(INDIRECT("'"&MySheets&"'!A5"), "x"))


--
Regards,

Peo Sjoblom



"Laffin" wrote in message
...
I have a workbook with several sheets. I am trying to determine how many
times "x" appears - using a specific cell (A5) as my reference in each of
the sheets. I want to count how many times "x" appears in cell A5 within
all
the worksheets and summarize on a summary worksheet. So, if I have 9
worksheets that I want to count, I want to know that "x" appears in only 7
of
the worksheets.




  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,268
Default Count Text within Multiple Worksheets

If you only have 2 sheets you can hardcode the name into the formula like
this

=SUMPRODUCT(COUNTIF(INDIRECT("'"&{"43-03951804";"80-06069282"}&"'!A5"),"x"))


obviously if you had 30 sheets the formula would get out of hand hardcoded


--
Regards,

Peo Sjoblom



"Laffin" wrote in message
...
Your recommendation of putting the sheet names in a range of cells worked
for
me. Thank you so much for that. However, since most of my sheets will
not
likely have a pattern, if I only had two sheets I wanted to use and the
names
were 43-03951804 and 80-06069282, how would I write the formula without
putting them in a range?

"Peo Sjoblom" wrote:

Are the sheets named like name1. name2 and so on? If so use

=SUMPRODUCT(COUNTIF(INDIRECT("'Name"&{1;2;3;4;5;6; 7;8;9}&"'!A5"),"x"))

replace Name with whatever name you use for the sheets

however if each name is not in a patter like the above the easiest way
is
to put all sheets name in a range, for instance if you put then in H1:H9
in
the summary sheet,

then you can use

=SUMPRODUCT(COUNTIF(INDIRECT("'"&H1:H9&"'!A5"),"x" ))


or select H1:H9, do insertnamedefine and give it a name like
MySheets, then you can use


=SUMPRODUCT(COUNTIF(INDIRECT("'"&MySheets&"'!A5"), "x"))


--
Regards,

Peo Sjoblom



"Laffin" wrote in message
...
I have a workbook with several sheets. I am trying to determine how
many
times "x" appears - using a specific cell (A5) as my reference in each
of
the sheets. I want to count how many times "x" appears in cell A5
within
all
the worksheets and summarize on a summary worksheet. So, if I have 9
worksheets that I want to count, I want to know that "x" appears in
only 7
of
the worksheets.






  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4
Default Count Text within Multiple Worksheets

Perfect! Thank you so much!

"Peo Sjoblom" wrote:

If you only have 2 sheets you can hardcode the name into the formula like
this

=SUMPRODUCT(COUNTIF(INDIRECT("'"&{"43-03951804";"80-06069282"}&"'!A5"),"x"))


obviously if you had 30 sheets the formula would get out of hand hardcoded


--
Regards,

Peo Sjoblom



"Laffin" wrote in message
...
Your recommendation of putting the sheet names in a range of cells worked
for
me. Thank you so much for that. However, since most of my sheets will
not
likely have a pattern, if I only had two sheets I wanted to use and the
names
were 43-03951804 and 80-06069282, how would I write the formula without
putting them in a range?

"Peo Sjoblom" wrote:

Are the sheets named like name1. name2 and so on? If so use

=SUMPRODUCT(COUNTIF(INDIRECT("'Name"&{1;2;3;4;5;6; 7;8;9}&"'!A5"),"x"))

replace Name with whatever name you use for the sheets

however if each name is not in a patter like the above the easiest way
is
to put all sheets name in a range, for instance if you put then in H1:H9
in
the summary sheet,

then you can use

=SUMPRODUCT(COUNTIF(INDIRECT("'"&H1:H9&"'!A5"),"x" ))


or select H1:H9, do insertnamedefine and give it a name like
MySheets, then you can use


=SUMPRODUCT(COUNTIF(INDIRECT("'"&MySheets&"'!A5"), "x"))


--
Regards,

Peo Sjoblom



"Laffin" wrote in message
...
I have a workbook with several sheets. I am trying to determine how
many
times "x" appears - using a specific cell (A5) as my reference in each
of
the sheets. I want to count how many times "x" appears in cell A5
within
all
the worksheets and summarize on a summary worksheet. So, if I have 9
worksheets that I want to count, I want to know that "x" appears in
only 7
of
the worksheets.






  #9   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default Count Text within Multiple Worksheets

If you only have 2 sheets involved:

=COUNTIF('43-03951804'!A5,"x")+COUNTIF('80-06069282'!A5,"x")

Biff

"Laffin" wrote in message
...
Perfect! Thank you so much!

"Peo Sjoblom" wrote:

If you only have 2 sheets you can hardcode the name into the formula like
this

=SUMPRODUCT(COUNTIF(INDIRECT("'"&{"43-03951804";"80-06069282"}&"'!A5"),"x"))


obviously if you had 30 sheets the formula would get out of hand
hardcoded


--
Regards,

Peo Sjoblom



"Laffin" wrote in message
...
Your recommendation of putting the sheet names in a range of cells
worked
for
me. Thank you so much for that. However, since most of my sheets will
not
likely have a pattern, if I only had two sheets I wanted to use and the
names
were 43-03951804 and 80-06069282, how would I write the formula without
putting them in a range?

"Peo Sjoblom" wrote:

Are the sheets named like name1. name2 and so on? If so use

=SUMPRODUCT(COUNTIF(INDIRECT("'Name"&{1;2;3;4;5;6; 7;8;9}&"'!A5"),"x"))

replace Name with whatever name you use for the sheets

however if each name is not in a patter like the above the easiest
way
is
to put all sheets name in a range, for instance if you put then in
H1:H9
in
the summary sheet,

then you can use

=SUMPRODUCT(COUNTIF(INDIRECT("'"&H1:H9&"'!A5"),"x" ))


or select H1:H9, do insertnamedefine and give it a name like
MySheets, then you can use


=SUMPRODUCT(COUNTIF(INDIRECT("'"&MySheets&"'!A5"), "x"))


--
Regards,

Peo Sjoblom



"Laffin" wrote in message
...
I have a workbook with several sheets. I am trying to determine how
many
times "x" appears - using a specific cell (A5) as my reference in
each
of
the sheets. I want to count how many times "x" appears in cell A5
within
all
the worksheets and summarize on a summary worksheet. So, if I have
9
worksheets that I want to count, I want to know that "x" appears in
only 7
of
the worksheets.








  #10   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4
Default Count Text within Multiple Worksheets

If I wanted to insert two dummy sheets at the first and last of my worksheets
(called First and Last). I tried the following formula:

=SUMPRODUCT(COUNTIF(INDIRECT("'"&First:Last&"'!F16 "),"x"))

and got this error (#NAME?). I would like to be able to just insert sheets
like this if possible as I will be receiving the worksheets via email and
just need to summarize specific fields.


"Peo Sjoblom" wrote:

If you only have 2 sheets you can hardcode the name into the formula like
this

=SUMPRODUCT(COUNTIF(INDIRECT("'"&{"43-03951804";"80-06069282"}&"'!A5"),"x"))


obviously if you had 30 sheets the formula would get out of hand hardcoded


--
Regards,

Peo Sjoblom



"Laffin" wrote in message
...
Your recommendation of putting the sheet names in a range of cells worked
for
me. Thank you so much for that. However, since most of my sheets will
not
likely have a pattern, if I only had two sheets I wanted to use and the
names
were 43-03951804 and 80-06069282, how would I write the formula without
putting them in a range?

"Peo Sjoblom" wrote:

Are the sheets named like name1. name2 and so on? If so use

=SUMPRODUCT(COUNTIF(INDIRECT("'Name"&{1;2;3;4;5;6; 7;8;9}&"'!A5"),"x"))

replace Name with whatever name you use for the sheets

however if each name is not in a patter like the above the easiest way
is
to put all sheets name in a range, for instance if you put then in H1:H9
in
the summary sheet,

then you can use

=SUMPRODUCT(COUNTIF(INDIRECT("'"&H1:H9&"'!A5"),"x" ))


or select H1:H9, do insertnamedefine and give it a name like
MySheets, then you can use


=SUMPRODUCT(COUNTIF(INDIRECT("'"&MySheets&"'!A5"), "x"))


--
Regards,

Peo Sjoblom



"Laffin" wrote in message
...
I have a workbook with several sheets. I am trying to determine how
many
times "x" appears - using a specific cell (A5) as my reference in each
of
the sheets. I want to count how many times "x" appears in cell A5
within
all
the worksheets and summarize on a summary worksheet. So, if I have 9
worksheets that I want to count, I want to know that "x" appears in
only 7
of
the worksheets.








  #11   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,886
Default Count Text within Multiple Worksheets

Hi

One way would be to use another cell on each sheet, e.g. cell X1 with a
formula
=IF(A5="x",1,0)

then on your Summary sheet (presumably Sheet10)
=SUM(Sheet1:Sheet9!X1)
You could insert 2 dummy sheets, and name them First and Last.
Drag them to positions where they encompass your 9 sheets in a sort of
"sandwich", with your summary sheet being outside of the sandwich.
Then
=SUM(First:Last!X1)

You can then drag sheets in and out of the sandwich to make the count
only operational on some of your sheets if you wish.


--
Regards

Roger Govier


"Laffin" wrote in message
...
I have a workbook with several sheets. I am trying to determine how
many
times "x" appears - using a specific cell (A5) as my reference in
each of
the sheets. I want to count how many times "x" appears in cell A5
within all
the worksheets and summarize on a summary worksheet. So, if I have 9
worksheets that I want to count, I want to know that "x" appears in
only 7 of
the worksheets.



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
Count single Text in cells with multiple text entries WSC Excel Discussion (Misc queries) 6 January 9th 07 04:17 PM
count 2 nonblank cells on multiple worksheets April Excel Discussion (Misc queries) 1 April 18th 06 09:15 AM
Simple Way to Count the Number of Duplicate Dates on Multiple Worksheets Dan Excel Discussion (Misc queries) 2 February 23rd 06 11:46 PM
Same Text on Multiple Worksheets Brennan Excel Discussion (Misc queries) 2 November 30th 05 05:26 PM
Count # of times value "x" appear across multiple worksheets eggdrunk Excel Worksheet Functions 0 June 9th 05 04:49 PM


All times are GMT +1. The time now is 05:57 AM.

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"