+ Reply to Thread
Results 1 to 3 of 3

Count Number of Sheets in Workbook Based on Criteria in Sheet Name

  1. #1
    Forum Contributor
    Join Date
    11-10-2011
    Location
    New York, NY
    MS-Off Ver
    MS Office: Excel 365
    Posts
    163

    Count Number of Sheets in Workbook Based on Criteria in Sheet Name

    Hello,

    I have a workbook with multiple sheets - one for each client.
    I also have a client list in the same workbook (lets say, starting in A1).
    I want to add a column to the client list noting whether there's a sheet with that client name in the workbook (via COUNTIF then IF so that it returns "YES" or "NO")

    Is this possible?

    Thank you!

    UPDATE: Just realized I could just use INDIRECT, based off the client name in the list, and have it return the value in cells "A1 of that sheet, then wrap it w/ IFERROR and IF statements to return a "NO" if it comes back as an error (i.e. no sheet with that name), and "YES" if it doesn't. This isn't the best solution (i.e. if there is a sheet but there happens to be an error in cell A1 of a client sheet, the formula would return a "NO". I don't plan on this happening, so I'll use this idea for now, but please feel free to let me know if there's a non "work around" answer to my original question.
    Last edited by xtinct2; 04-25-2016 at 05:04 PM. Reason: "work around" solution found

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Count Number of Sheets in Workbook Based on Criteria in Sheet Name

    Try this...

    =IF(ISREF(INDIRECT("'"&A1&"'!A1")),"Yes","No")
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Forum Expert
    Join Date
    08-16-2015
    Location
    Antwerpen, Belgium
    MS-Off Ver
    2007-2016
    Posts
    2,380

    Re: Count Number of Sheets in Workbook Based on Criteria in Sheet Name

    Change the B to the desired Column

    Please Login or Register  to view this content.
    Kind regards
    Leo

+ 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. Replies: 7
    Last Post: 02-22-2014, 01:17 AM
  2. Replies: 1
    Last Post: 02-21-2014, 09:04 PM
  3. Replies: 1
    Last Post: 10-04-2013, 04:21 AM
  4. Count Number of Sheets in a Workbook
    By Neale in forum Excel General
    Replies: 2
    Last Post: 04-14-2010, 01:15 PM
  5. [SOLVED] I Need to Count Number of Entries Based on Two Criteria
    By CLR in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 09-06-2005, 03:05 PM
  6. [SOLVED] I Need to Count Number of Entries Based on Two Criteria
    By CLR in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 09-06-2005, 04:05 AM
  7. [SOLVED] I Need to Count Number of Entries Based on Two Criteria
    By Jones in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 02:05 AM
  8. I Need to Count Number of Entries Based on Two Criteria
    By Jones in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 12:05 AM

Tags for this Thread

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