+ Reply to Thread
Results 1 to 5 of 5

Counting specific values from same cells over multiple sheets

Hybrid View

Copernicus19 Counting specific values from... 07-19-2019, 07:14 PM
AHS7-17 Re: Counting specific values... 07-20-2019, 12:48 AM
FDibbins Re: Counting specific values... 07-20-2019, 12:59 AM
Copernicus19 Re: Counting specific values... 07-20-2019, 01:27 AM
FDibbins Re: Counting specific values... 07-20-2019, 01:29 AM
  1. #1
    Registered User
    Join Date
    07-17-2019
    Location
    Canada
    MS-Off Ver
    Office 365
    Posts
    9

    Counting specific values from same cells over multiple sheets

    I am trying to do a count of how many cells equal specific text. I tried to do a COUNTA already, but the cells I'm trying to add have a formula in them so its counting all of them. Also tried to do a COUNTIF, but it was becoming an extremely long formula. I also tried to do a range across multiple worksheets, but couldn't make that work either.

    I have attached a sample book, deleted data that is not relevant. In the "SEASON" tab, I want column Y and AR to count if "O" or "D" is found in the cells in each of the other tabs. (There are 21 tabs to count from, I've included three in the sample.)

    In each of the tabs not named "SEASON", cells Y6:Y55 and cells AO6:AO55 have a formula which calculates a possible value of "O" or "D" (can also have no value). If those cells have a value of "O" or "D", I want them to be counted in the "SEASON" tab in cells Y6:Y55 and AR6:AR55.

    If the formula that is counting is correct the count should be five for all ten numbers that have an "O" or "D" value.

    (Sample book removed after solved.)
    Last edited by Copernicus19; 07-20-2019 at 01:29 AM.

  2. #2
    Registered User
    Join Date
    07-19-2019
    Location
    Calgary, Canada
    MS-Off Ver
    Office 365
    Posts
    1

    Re: Counting specific values from same cells over multiple sheets

    Create a name for your group of data source sheets. In my attachment I've named sheets 2-4 "Games".

    In cell Y6 of the Season sheet use this formula: =SUMPRODUCT(COUNTIF(INDIRECT("'"&Games&"'!Y6"),"O"))+SUMPRODUCT(COUNTIF(INDIRECT("'"&Games&"'!Y6"),"D"))
    . . INDIRECT is needed to apply COUNTIF to multiple sheets. SUMPRODUCT is needed to add results for all sheets.
    . . Have to essentially duplicate the formula to count both "O" and "D".

    Weakness of this solution: the target range (Y6 above) is not a relative cell reference; so the formula won't change when you copy it to other rows --must change the number manually!

    [file deleted after solved]
    Last edited by AHS7-17; 07-20-2019 at 01:30 AM.

  3. #3
    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,048

    Re: Counting specific values from same cells over multiple sheets

    To add to AHS7's suggestion, here is how you would create a list of your sheets so you can give them all a named range...

    1st create a range name (I called mine Sheetnanes)
    Then put this in the Refers To box: =REPLACE(GET.WORKBOOK(1),1,FIND("]",GET.WORKBOOK(1)),"")

    To get a list of sheet names, put this in a cell and copy down (started in A2)...
    =IFERROR(INDEX(Sheetnames,ROWS($A$2:A2)),"")
    Delete the 1st 3 names (or however many do not apply)
    You can then give that list a named range.

    A shortened version of AHS7's very good formula would be
    =SUMPRODUCT(COUNTIF(INDIRECT("'"&Games&"'!Y"&ROW()),{"O","D"}))
    copied down

    This will adjust the rows as you copy it down
    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

  4. #4
    Registered User
    Join Date
    07-17-2019
    Location
    Canada
    MS-Off Ver
    Office 365
    Posts
    9

    Re: Counting specific values from same cells over multiple sheets

    Thanks AHS-7 and FDibbins! Very good solutions, and the ability to copy down to other cells is great.

    I tested it and it works perfectly. Thanks again.

  5. #5
    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,048

    Re: Counting specific values from same cells over multiple sheets

    Happy to help (AHS did the heavy lifting though)

+ 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: 12
    Last Post: 02-10-2014, 11:59 AM
  2. Counting Values across multiple sheets
    By chris.slater in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 10-31-2013, 10:49 AM
  3. [SOLVED] Counting Specific Text Occurences in Cells Adjacent to Particular Values
    By lowlybroker in forum Excel General
    Replies: 7
    Last Post: 10-21-2013, 12:07 PM
  4. Please help! Counting values in specific colored cells
    By dilemmax in forum Excel General
    Replies: 3
    Last Post: 02-08-2013, 01:13 PM
  5. Counting Cells With Multiple Criteria on Multiple Sheets
    By ericmeiers in forum Excel General
    Replies: 5
    Last Post: 08-04-2012, 10:23 PM
  6. Counting Cells With 2 Specific Values and Getting a Percentage Complete
    By RobynJC in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-22-2010, 04:21 PM
  7. Counting Cells with Specific values
    By javaman12 in forum Excel General
    Replies: 1
    Last Post: 04-20-2009, 03:54 PM
  8. [SOLVED] Counting text across multiple sheets with a specific criterion
    By Gitel in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 11-13-2005, 10:25 AM

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