Consulting

Results 1 to 2 of 2

Thread: count a filtered sheet

  1. #1
    VBAX Tutor
    Joined
    Oct 2007
    Posts
    210
    Location

    count a filtered sheet

    I have a sheet that I filtered one column (A). Another column (B) has TRUE/FALSE data in it. I would like to be able to count the number of TRUEs in the filtered list. How do you do this?
    "The amount of stupid people in the world is God's way of punishing the smart people" - protean_being

  2. #2
    Moderator VBAX Guru Simon Lloyd's Avatar
    Joined
    Sep 2005
    Location
    UK
    Posts
    3,003
    Location
    Try this:
    =SUMPRODUCT(($B$1:$B$100=TRUE)*(SUBTOTAL(3,OFFSET($B$1,ROW($B$1:$B$100)-MIN(ROW($B$1:$B$100)),,))))
    if you havent filtered your data it will show the total amount if you hide a row it has no effect it still shows the total amount if you filter your data it will show the total of visible TRUE's.

    You can thank xld for showing me the path to enlightenment on this one!
    Regards,
    Simon
    Please read this before cross posting!
    In the unlikely event you didn't get your answer here try Microsoft Office Discussion @ The Code Cage
    If I have seen further it is by standing on the shoulders of giants.
    Isaac Newton, Letter to Robert Hooke, February 5, 1675 English mathematician & physicist (1642 - 1727)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •