+ Reply to Thread
Results 1 to 3 of 3

CountIf across multiple sheets

  1. #1
    Registered User
    Join Date
    09-16-2011
    Location
    New Jersey
    MS-Off Ver
    Excel 2007
    Posts
    2

    CountIf across multiple sheets

    Hi,

    I have a bunch of sheets, in which column A has some fruits, for example. I want to know how many apples there are total, across all the sheets. How do I do that? I know you can't use countif for the whole workbook. But how can I do it using sumproduct? I can't use any macros or external libraries or anything like that.

    Sheet Jan2005:
    Apple
    Apple
    Apple
    Banana

    Sheet Feb006:
    Banana
    Banana
    Plum

    Sheet March2007:
    Apple
    Apple
    Last edited by NBVC; 09-16-2011 at 01:52 PM.

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,902

    Re: CountIf across multiple sheets

    If you list the sheetnames somewhere.. then you can try something like:

    =SUMPRODUCT(COUNTIF(INDIRECT("'"&$X$1:$X$10&"'!A:A"),"Apple"))

    where X1:X10 on the active sheet has the sheetnames.

    You can name the range and use that named range too. And you can replace "Apple" with a cell reference containing the search term.
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Registered User
    Join Date
    09-16-2011
    Location
    New Jersey
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: CountIf across multiple sheets

    Thank you so much, that worked!

    Quote Originally Posted by NBVC View Post
    If you list the sheetnames somewhere.. then you can try something like:

    =SUMPRODUCT(COUNTIF(INDIRECT("'"&$X$1:$X$10&"'!A:A"),"Apple"))

    where X1:X10 on the active sheet has the sheetnames.

    You can name the range and use that named range too. And you can replace "Apple" with a cell reference containing the search term.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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