Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Trevor Shuttleworth
 
Posts: n/a
Default =COUNTIF across Worksheets

How can I turn a formula like:

=COUNTIF('Person 1'!$C8,"Off")+COUNTIF('Person 2'!$C8,"Off")+COUNTIF('Person
3'!$C8,"Off")+COUNTIF('Person 4'!$C8,"Off")+COUNTIF('Person 5'!$C8,"Off")

Into (something like):

=COUNTIF('Person 1':'Person 5'!$C8,"Off") ... this gives #NAME?
=COUNTIF('Person 1:Person 5'!$C8,"Off") ... this gives #VALUE!

It doesn't have to be the COUNTIF function so long as it achieves the same
ends.

I need to be able to add more people without a vast amount of repetition.
It would look neater and simpler too!

Thanks in advance

Trevor


  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
JE McGimpsey
 
Posts: n/a
Default =COUNTIF across Worksheets

You can change the SUMIF()'s in the solution provided he

http://www.mcgimpsey.com/excel/threedsumif.html

to COUNTIF()s, and use SUM() to sum across sheets. If you use wrapper
sheets (e.g., all your new sheets go between the first and last), you
can use

=SUM(first:last!Z1)

to include all intermediate sheets.

In article ,
"Trevor Shuttleworth" wrote:

How can I turn a formula like:

=COUNTIF('Person 1'!$C8,"Off")+COUNTIF('Person 2'!$C8,"Off")+COUNTIF('Person
3'!$C8,"Off")+COUNTIF('Person 4'!$C8,"Off")+COUNTIF('Person 5'!$C8,"Off")

Into (something like):

=COUNTIF('Person 1':'Person 5'!$C8,"Off") ... this gives #NAME?
=COUNTIF('Person 1:Person 5'!$C8,"Off") ... this gives #VALUE!

It doesn't have to be the COUNTIF function so long as it achieves the same
ends.

I need to be able to add more people without a vast amount of repetition.
It would look neater and simpler too!

Thanks in advance

Trevor

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Aladin Akyurek
 
Posts: n/a
Default =COUNTIF across Worksheets

If you have Longre's free morefunc.xll add-in:

=COUNTIF.3D('Person 1':'Person 5'!$C8,"Off")

Otherwise:

=SUMPRODUCT(COUNTIF(INDIRECT("'"&SheetList&"'!C8") ,"Off"))

where SheetList refers to a range housing the relevant sheetnames in
separate cells.

Trevor Shuttleworth wrote:
How can I turn a formula like:

=COUNTIF('Person 1'!$C8,"Off")+COUNTIF('Person 2'!$C8,"Off")+COUNTIF('Person
3'!$C8,"Off")+COUNTIF('Person 4'!$C8,"Off")+COUNTIF('Person 5'!$C8,"Off")

Into (something like):

=COUNTIF('Person 1':'Person 5'!$C8,"Off") ... this gives #NAME?
=COUNTIF('Person 1:Person 5'!$C8,"Off") ... this gives #VALUE!

It doesn't have to be the COUNTIF function so long as it achieves the same
ends.

I need to be able to add more people without a vast amount of repetition.
It would look neater and simpler too!

Thanks in advance

Trevor


  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Trevor Shuttleworth
 
Posts: n/a
Default =COUNTIF across Worksheets

Many thanks.

I'm favouring the SUMPRODUCT option ... but at least now I have some options
to consider which is a huge plus

Regards

Trevor


"JE McGimpsey" wrote in message
...
You can change the SUMIF()'s in the solution provided he

http://www.mcgimpsey.com/excel/threedsumif.html

to COUNTIF()s, and use SUM() to sum across sheets. If you use wrapper
sheets (e.g., all your new sheets go between the first and last), you
can use

=SUM(first:last!Z1)

to include all intermediate sheets.

In article ,
"Trevor Shuttleworth" wrote:

How can I turn a formula like:

=COUNTIF('Person 1'!$C8,"Off")+COUNTIF('Person
2'!$C8,"Off")+COUNTIF('Person
3'!$C8,"Off")+COUNTIF('Person 4'!$C8,"Off")+COUNTIF('Person 5'!$C8,"Off")

Into (something like):

=COUNTIF('Person 1':'Person 5'!$C8,"Off") ... this gives #NAME?
=COUNTIF('Person 1:Person 5'!$C8,"Off") ... this gives #VALUE!

It doesn't have to be the COUNTIF function so long as it achieves the
same
ends.

I need to be able to add more people without a vast amount of repetition.
It would look neater and simpler too!

Thanks in advance

Trevor



  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Peo Sjoblom
 
Posts: n/a
Default =COUNTIF across Worksheets

Assuming that the sheets are not called person1 but maybe a persons name you
need to put all sheet names in question in a range like in

person1
person2
person3
etc..

now assume you have 5 different sheet names and put them in H1:H5

then you can use

=SUMPRODUCT(COUNTIF(INDIRECT("'"&H1:H5&"'!C8"),"OF F"))


if the sheets have the same name plus a number you can use

=SUMPRODUCT(COUNTIF(INDIRECT("'Person"&ROW(INDIREC T("1:5"))&"'!C8"),"OFF"))

--
Regards,

Peo Sjoblom

(No private emails please)


"Trevor Shuttleworth" wrote in message
...
How can I turn a formula like:

=COUNTIF('Person 1'!$C8,"Off")+COUNTIF('Person
2'!$C8,"Off")+COUNTIF('Person 3'!$C8,"Off")+COUNTIF('Person
4'!$C8,"Off")+COUNTIF('Person 5'!$C8,"Off")

Into (something like):

=COUNTIF('Person 1':'Person 5'!$C8,"Off") ... this gives #NAME?
=COUNTIF('Person 1:Person 5'!$C8,"Off") ... this gives #VALUE!

It doesn't have to be the COUNTIF function so long as it achieves the same
ends.

I need to be able to add more people without a vast amount of repetition.
It would look neater and simpler too!

Thanks in advance

Trevor




  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Trevor Shuttleworth
 
Posts: n/a
Default =COUNTIF across Worksheets

Many thanks

It just gets better. I can't use the MOREFUNC.XLL as I work in a strictly
controlled environment where it would not be possible to distribute the
Add-in

However, the SUMPRODUCT option is looking good

Regards

Trevor


"Aladin Akyurek" wrote in message
...
If you have Longre's free morefunc.xll add-in:

=COUNTIF.3D('Person 1':'Person 5'!$C8,"Off")

Otherwise:

=SUMPRODUCT(COUNTIF(INDIRECT("'"&SheetList&"'!C8") ,"Off"))

where SheetList refers to a range housing the relevant sheetnames in
separate cells.

Trevor Shuttleworth wrote:
How can I turn a formula like:

=COUNTIF('Person 1'!$C8,"Off")+COUNTIF('Person
2'!$C8,"Off")+COUNTIF('Person 3'!$C8,"Off")+COUNTIF('Person
4'!$C8,"Off")+COUNTIF('Person 5'!$C8,"Off")

Into (something like):

=COUNTIF('Person 1':'Person 5'!$C8,"Off") ... this gives #NAME?
=COUNTIF('Person 1:Person 5'!$C8,"Off") ... this gives #VALUE!

It doesn't have to be the COUNTIF function so long as it achieves the
same ends.

I need to be able to add more people without a vast amount of repetition.
It would look neater and simpler too!

Thanks in advance

Trevor



  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Trevor Shuttleworth
 
Posts: n/a
Default =COUNTIF across Worksheets

Thanks Peo ... and also JE and Aladin

Three answers within 30 minutes ... truly impressive. I've opted for the
SUMPRODUCT Option with the list of worksheet names on a Control Sheet.

I've actually defined a dynamic named range which allows me to home in on a
subset of the worksheets ... and make the formula more informative (I think)

=SUMPRODUCT(COUNTIF(INDIRECT("'"&PeopleList&"'!"&C ELL("address",C8)),"Off"))

This version also has the advantage that I can drag the formula down and the
cell will automatically change ... C8 to C9 to C10, etc

The named range PeopleList is defined as:
=OFFSET(Controls!$H$4,,,COUNTA(Controls!$I:$I),)

I list the sheet names in column H on the Controls sheet and then put real
names next to them in Column H

Thanks again for all the help

Trevor


"Peo Sjoblom" wrote in message
...
Assuming that the sheets are not called person1 but maybe a persons name
you need to put all sheet names in question in a range like in

person1
person2
person3
etc..

now assume you have 5 different sheet names and put them in H1:H5

then you can use

=SUMPRODUCT(COUNTIF(INDIRECT("'"&H1:H5&"'!C8"),"OF F"))


if the sheets have the same name plus a number you can use

=SUMPRODUCT(COUNTIF(INDIRECT("'Person"&ROW(INDIREC T("1:5"))&"'!C8"),"OFF"))

--
Regards,

Peo Sjoblom

(No private emails please)


"Trevor Shuttleworth" wrote in message
...
How can I turn a formula like:

=COUNTIF('Person 1'!$C8,"Off")+COUNTIF('Person
2'!$C8,"Off")+COUNTIF('Person 3'!$C8,"Off")+COUNTIF('Person
4'!$C8,"Off")+COUNTIF('Person 5'!$C8,"Off")

Into (something like):

=COUNTIF('Person 1':'Person 5'!$C8,"Off") ... this gives #NAME?
=COUNTIF('Person 1:Person 5'!$C8,"Off") ... this gives #VALUE!

It doesn't have to be the COUNTIF function so long as it achieves the
same ends.

I need to be able to add more people without a vast amount of repetition.
It would look neater and simpler too!

Thanks in advance

Trevor




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
Changing a Link Mid-way Across Worksheets Frosty Excel Worksheet Functions 0 August 25th 05 12:03 AM
Spawning worksheets and a summary per worksheet username Excel Discussion (Misc queries) 0 May 23rd 05 09:57 PM
How to protect and unprotect 30 worksheets in a file every month . Protect & Unprotect Several Worksheets Excel Worksheet Functions 4 January 10th 05 01:29 PM
Protect/unprotect all worksheets Janna Excel Worksheet Functions 2 January 7th 05 01:01 AM
HELP! How do you--> Lock a set of rows but also link worksheets to FRUSTRATED Excel Discussion (Misc queries) 6 December 29th 04 10:05 PM


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