Closed Thread
Results 1 to 6 of 6

Subtotal Count Words!!

  1. #1
    Registered User
    Join Date
    07-11-2007
    Posts
    25

    Subtotal Count Words!!

    Hi,

    I have a column "completed" which either contains the words "yes" or "no". I also have an auto filter on this column and need a subtotal function that will return the amount of "yes" when filtered.

    Any ideas?

  2. #2
    Forum Expert
    Join Date
    01-12-2007
    Location
    New Jersey
    Posts
    2,127
    You can always use a COUNTIF function:

    =COUNTIF(A1:A100,"YES")

    (Adjust range to suit). Let me know if that helps.

  3. #3
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Subtotal Count Words!!

    Try using the SUBTOTAL function.....

    If your filtered data is in A5:A100 (with A5 as the col heading)
    this formula counts the number of non-blank visible filtered cells:
    A4: =SUBTOTAL(3,A6:A100)

    Other options for the first argument of SUBTOTAL are:
    Num Function
    1 AVERAGE
    2 COUNT
    3 COUNTA
    4 MAX
    5 MIN
    6 PRODUCT
    7 STDEV
    8 STDEVP
    9 SUM
    10 VAR
    11 VARP

    Does that help?
    Ron
    Former Microsoft MVP - Excel (2006 - 2015)
    Click here to see the Forum Rules

  4. #4
    Registered User
    Join Date
    07-11-2007
    Posts
    25
    i'm farmilia with the SUBTOTAL function, the prolem i have is subtotalling the "yes" when the filter is on.

  5. #5
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Subtotal Count Words!!

    I guessed that you filtered to display "yes" values....Evidently, no.

    If the data with yes/no values is in B1:B100, with B1 as the col heading

    This formula counts the occurrences of "yes" in the visible filtered range:
    =SUMPRODUCT(SUBTOTAL(3,OFFSET(B2:B100,ROW(B2:B100)-ROW(B2),0,1))*(B2:B100="yes"))

    Note: there are NO spaces in that formula

    Is that something you can work with?

  6. #6
    Registered User
    Join Date
    07-11-2007
    Posts
    25
    worked great, cheers.

Closed 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