+ Reply to Thread
Results 1 to 13 of 13

Count the occurence of a value across multiple worksheets

  1. #1
    Registered User
    Join Date
    02-26-2009
    Location
    STL MO USA
    MS-Off Ver
    Office 2007
    Posts
    8

    Count the occurence of a value across multiple worksheets

    Greetings! I'm Tim, and I'm just an average Excel user who found his way here through Google. I did a little poking around and this looks like a great community. Maybe I can contribute on future visits.

    I'm wracking my brains over this one but I can't seem to get anywhere. What is easy on a single worksheet becomes a conceptual nightmare when extended across multiple sheets........

    I have an Excel 2007 workbook with ten worksheets, each is 5 columns by *about 50 rows. My column headings are the same on each sheet. All of the cells are formatted as Text.

    Please Login or Register  to view this content.
    I need to know how many times each value in column C appears across the entire workbook, and I need the results to be inversly sorted by the number of times that each value appears.

    Please Login or Register  to view this content.
    Can someone help me out of this mess?
    Last edited by timtrace; 03-02-2009 at 12:09 AM.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Count the occurence of a value across multiple worksheets

    This chart handles duplicate values, too with no arrays. Use chart on right to collect the raw sums, then the formulas in A and B to collate/rank the data.

    This is the formula I used to CountIf across multiple sheets:

    =SUM(COUNTIF(INDIRECT("Sheet"&{1,2,3}&"!C1:C1000"),"="&H2))

    Then some tricky ranking stuff to put them in order, regardless of duplicate count values.
    Last edited by JBeaucaire; 02-27-2009 at 12:40 AM. Reason: Removed workbook, use the one from further down.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    02-26-2009
    Location
    STL MO USA
    MS-Off Ver
    Office 2007
    Posts
    8

    Re: Count the occurence of a value across multiple worksheets

    That's some nice work. In my case I won't know any of the values until I view the results. What a sticky mess, eh?

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Count the occurence of a value across multiple worksheets

    Not at all. I just imagined that the values you count could duplicate, and it's tough getting the Rank / Results section to properly sort without some sort of unique ID to make it happen.

    Here's a slight variation on the column A formula, a little less traumatic and it doesn't evaluate twice like the first one did.

    If that takes care of your need, be sure to EDIT your original post (Go Advanced) and mark the PREFIX box [SOLVED]
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    02-26-2009
    Location
    STL MO USA
    MS-Off Ver
    Office 2007
    Posts
    8

    Re: Count the occurence of a value across multiple worksheets

    Thank you VERY much. I'm looking forward to evaluating this over the weekend.

    I've attached an improved set of sample data which is a better representation of my production workbook. Notice that some of the values in the Name column are duplicated on the same sheet....and sometimes on other sheets. Some values will occur only once in the entire workbook; others will occur much more often.

    I'm looking to find out how many times each value appears across all of the sheets. Perhaps your example will give me what I need....we'll see
    Attached Files Attached Files
    Last edited by timtrace; 02-27-2009 at 07:14 PM.

  6. #6
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Count the occurence of a value across multiple worksheets

    A little help here...
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    02-26-2009
    Location
    STL MO USA
    MS-Off Ver
    Office 2007
    Posts
    8

    Re: Count the occurence of a value across multiple worksheets

    Ah, thank you, very interesting. It won't be much trouble at all to manually create the "candidates table"....thank you!

  8. #8
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Count the occurence of a value across multiple worksheets

    Sounds good.

    If that takes care of your need, be sure to EDIT your original post (Go Advanced) and mark the PREFIX box [SOLVED]

  9. #9
    Registered User
    Join Date
    02-26-2009
    Location
    STL MO USA
    MS-Off Ver
    Office 2007
    Posts
    8

    Re: Count the occurence of a value across multiple worksheets

    Here's my final solution: http://preview.tinyurl.com/duplicatemaster

    It's a nice VBA app that does exactly what I need. Hopefully some other contributors to this community will find it useful.

  10. #10
    Registered User
    Join Date
    07-06-2011
    Location
    US
    MS-Off Ver
    Excel 2003
    Posts
    1

    Re: Count the occurence of a value across multiple worksheets

    I am attempting to do the same type of function. i have 16 worksheets (17 in the entire book, the first sheet is wehre i want the function, not where i want to pull information) from which i want to count a certain value. The value is located in B4 of each sheet and each sheet has a unique name. I simply want to count the number of times "Yes" appears across each of my worksheets on my first sheet titled "Dashboard".

  11. #11
    Registered User
    Join Date
    08-10-2011
    Location
    Bucharest, Romania
    MS-Off Ver
    Excel 2007
    Posts
    1

    Re: Count the occurence of a value across multiple worksheets

    Not at all. I just imagined that the values you count could duplicate, and it's tough getting the Rank / Results section to properly sort without some sort of unique ID to make it happen.

    Here's a slight variation on the column A formula, a little less traumatic and it doesn't evaluate twice like the first one did.


    thank you very much. it was very helpful.
    how do i refer to multiple sheets that have other naems than sheet1, sheet2....etc.


    thanks a lot.

  12. #12
    Registered User
    Join Date
    01-18-2012
    Location
    Atlanta, GA
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Count the occurence of a value across multiple worksheets

    This thread has been extremely helpful for me so far, and the MultiSheetRankedSearch.xls has been fantastic! I do have a question about potentially adding something else to the function.

    I have a sheet named "M" sheet where I gather all of the data from a "Manual" sheet. My chart looks like this:
    xls.jpg

    I'm using the column header names as opposed to the row names from your MultiSheetRankedSearch.xls (hopefully, that make sense). Nonetheless, I would like to use my row names (which are date ranges) within the function =SUM(COUNTIF(INDIRECT("Manual"&"!F2377:F3822"), "="&A9)). Is there anyway to use the date ranges in place of "!F2377:F3822" from the "Manual" sheet? I'm trying to use the function as dynamically as possible. Any help would be greatly appreciated!

  13. #13
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Count the occurence of a value across multiple worksheets

    Hi Todd... Welcome to the forum.

    Be sure to read through the Forum Rules so you can use and follow them effectively.

    For instance, you'll need to start a thread of your own, not add on to an ageold post. In your thread, feel free to provide a link to this thread if you feel it is relevant. In your thread attach your own workbook(s) to help demonstrate your need/goals, too. Click GO ADVANCED and use the paperclip icon to post up a copy of your workbook in your new thread.

    Thanks.

+ 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