Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
sm sm is offline
external usenet poster
 
Posts: 13
Default CountIf function refering to another worksheet

Hi,

I've been fighting with this problem for a while, and tried using examples
from other posts, but I seem to be missing something here!

I have a table set up on Sheet1. The headings contain the Names of the
other worksheets in the workbook (e.g. Sheet2, Sheet3 etc...). The rows
contain peoples' names (e.g. Smith, John etc...). Within each table element
I'm trying to insert a CountIf result that determines how often the name
appears in column S of a given worksheet such as Sheet2.

Here is some sample code I've tried with no success - there are many other
permutations I'll omit.

Cells(j, i) = "=COUNTIF('" & Cells(1, i) & "'!S:S, " & Cells(j, 1) & ")"
where
j = row of the table on Sheet1
i = column of the table on Sheet1
cells(1, i) = name of the worksheet containing the information to be
counted
cells(j,1) = name of the person that is the CountIf argument

Any suggestions to get this to work would be greatly appreaciated!

SM
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default CountIf function refering to another worksheet

Try the below. You missed the double quotes

Cells(j, i) = "=COUNTIF('" & Cells(1, i) & "'!S:S, """ & Cells(j, 1) & """)"

If this post helps click Yes
---------------
Jacob Skaria


"SM" wrote:

Hi,

I've been fighting with this problem for a while, and tried using examples
from other posts, but I seem to be missing something here!

I have a table set up on Sheet1. The headings contain the Names of the
other worksheets in the workbook (e.g. Sheet2, Sheet3 etc...). The rows
contain peoples' names (e.g. Smith, John etc...). Within each table element
I'm trying to insert a CountIf result that determines how often the name
appears in column S of a given worksheet such as Sheet2.

Here is some sample code I've tried with no success - there are many other
permutations I'll omit.

Cells(j, i) = "=COUNTIF('" & Cells(1, i) & "'!S:S, " & Cells(j, 1) & ")"
where
j = row of the table on Sheet1
i = column of the table on Sheet1
cells(1, i) = name of the worksheet containing the information to be
counted
cells(j,1) = name of the person that is the CountIf argument

Any suggestions to get this to work would be greatly appreaciated!

SM

  #3   Report Post  
Posted to microsoft.public.excel.programming
sm sm is offline
external usenet poster
 
Posts: 13
Default CountIf function refering to another worksheet

Thank you! I had a feeling it had to do with the quotes, but I didn't try
the correct combination you have below.

"Jacob Skaria" wrote:

Try the below. You missed the double quotes

Cells(j, i) = "=COUNTIF('" & Cells(1, i) & "'!S:S, """ & Cells(j, 1) & """)"

If this post helps click Yes
---------------
Jacob Skaria


"SM" wrote:

Hi,

I've been fighting with this problem for a while, and tried using examples
from other posts, but I seem to be missing something here!

I have a table set up on Sheet1. The headings contain the Names of the
other worksheets in the workbook (e.g. Sheet2, Sheet3 etc...). The rows
contain peoples' names (e.g. Smith, John etc...). Within each table element
I'm trying to insert a CountIf result that determines how often the name
appears in column S of a given worksheet such as Sheet2.

Here is some sample code I've tried with no success - there are many other
permutations I'll omit.

Cells(j, i) = "=COUNTIF('" & Cells(1, i) & "'!S:S, " & Cells(j, 1) & ")"
where
j = row of the table on Sheet1
i = column of the table on Sheet1
cells(1, i) = name of the worksheet containing the information to be
counted
cells(j,1) = name of the person that is the CountIf argument

Any suggestions to get this to work would be greatly appreaciated!

SM

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
Refering cell to the worksheet name Dave Excel Worksheet Functions 6 October 1st 08 03:19 PM
Function refering sheet index. Joe_Germany Excel Worksheet Functions 4 July 28th 07 05:27 AM
Countif worksheet function frustrations Santa-D Excel Worksheet Functions 8 October 30th 06 05:14 AM
refering to a named range on a different worksheet [email protected] Excel Programming 2 October 10th 06 08:29 PM
Worksheet Function COUNTIF D.S.[_3_] Excel Programming 3 November 21st 03 07:20 AM


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