+ Reply to Thread
Results 1 to 10 of 10

Countif Formular cannot multiple sheets ?

  1. #1
    Registered User
    Join Date
    10-16-2013
    Location
    singapore
    MS-Off Ver
    Excel 2007
    Posts
    3

    Countif Formular cannot multiple sheets ?

    Anything Wrong in my formula ? it cannot work .

    =COUNTIF('Yan Zhao 8:31'!C5:C58,"NAM LEE")

    please help me correct it .
    Last edited by domingsun134; 10-16-2013 at 09:55 PM.

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,049

    Re: Anything Wrong in my formula ? it cannot work .

    Hi and welcome to the forum

    1st, please take a moment to read the forum rules and then amend your thread title to something descriptive of your problem. Once you have done this please send me a PM and I will remove this request. (Also, include a link to your thread - copy from the adress bar)

    To change a Title on your post, click EDIT POST then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.

    2nd It would be almost impossible to offer a suggestion as to why that doesnt work, without seeing a sample of the data you are using it on. Thats like saying...my car wont start, why?
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Anything Wrong in my formula ? it cannot work .

    Yan Zhao 8:31 is an invalid sheet name.

    Sheet names can not contain the colon character.

    Do you mean:

    Sheet Yan Zhao 8 thru sheet Yan Zhao 31?

    If so, change the thread title as requested then we'll be able to give you a solution.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,049

    Re: Countif Formular cannot multiple sheets ?

    Tony, congrats on the Expert status, very well deserved and about time

  5. #5
    Registered User
    Join Date
    10-16-2013
    Location
    singapore
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Countif Formular cannot multiple sheets ?

    Tony ,right .

    I want select the range in Sheet Yan Zhao 8 to Sheet 31

  6. #6
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Countif Formular cannot multiple sheets ?

    Hmmm...

    I've been an "expert" for quite a while, now.

    That's as far as I'm going.

  7. #7
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Countif Formular cannot multiple sheets ?

    Try it like this...

    A2 = NAM LEE

    =SUMPRODUCT(COUNTIF(INDIRECT("'Yan Zhao "&ROW(INDIRECT("8:31"))&"'!C5:C58"),A2))

  8. #8
    Registered User
    Join Date
    10-16-2013
    Location
    singapore
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Countif Formular cannot multiple sheets ?

    Tony , We do it easy abit .

    lets say i have sheet 1 and sheet 2 .

    I want count the supplier named Nam Lee .

    the range is C5:C58.

  9. #9
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Countif Formular cannot multiple sheets ?

    If the REAL sheet names are Sheet 1 and Sheet 2, then:

    =SUMPRODUCT(COUNTIF(INDIRECT("'Sheet "&{1,2}&"'!C5:C58"),A2))

    If the sheet names are random names and don't follow a sequential pattern then you'll have to list the sheet names in a range of cells and refer to that range.

    With the sheet names in the range B2:B10...

    =SUMPRODUCT(COUNTIF(INDIRECT("'"&B2:B10&"'!C5:C58"),A2))

  10. #10
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,426

    Re: Countif Formular cannot multiple sheets ?

    Another approach:

    You can't use 3-D references with COUNTIF, but what you can do is to put the COUNTIF formula in the same cell on every sheet, and then use a SUM across the sheets. So, put this formula in the same cell on sheets Yan Zhao 8 to Yan Zhao 31:

    =COUNTIF(C5:C58,"NAM LEE")

    an easy way to do this is to group those sheets together, then enter the formula (say into cell X1), then ungroup the sheets. Then you can have this formula on your summary sheet:

    =SUM('Yan Zhao 8:Yan Zhao 31'!X1)

    Hope this helps.

    Pete

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. 2 things wrong with this work book :(
    By niceguy21 in forum Excel General
    Replies: 1
    Last Post: 12-07-2012, 08:41 AM
  2. Replies: 0
    Last Post: 09-06-2005, 10:05 AM
  3. Replies: 24
    Last Post: 09-06-2005, 04:05 AM
  4. Replies: 0
    Last Post: 09-06-2005, 03:05 AM
  5. Replies: 0
    Last Post: 09-05-2005, 11:05 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1