+ Reply to Thread
Results 1 to 8 of 8

Formula Excluding Hidden Cells

  1. #1
    Registered User
    Join Date
    03-08-2007
    Posts
    20

    Formula Excluding Hidden Cells

    Hi,

    I am trying to figure out if a hidden group of cells can be excluded from a formula.

    Basically, I have a column which counts incidents each month.

    So A1 - A50 has a total count of 50.

    A1 - A25 is March, and A26 - A50 is April. So if I hide A1-A25, would it be posible to have my count formula to update automatically to remove the hidden cells?

    This would help me so that I could just add data each month, instead of having to copy paste and delete. + I could run reports for the whole year when needed.

    Kind Regards

    Colin

  2. #2
    Valued Forum Contributor rwgrietveld's Avatar
    Join Date
    09-02-2008
    Location
    Netherlands
    MS-Off Ver
    XL 2007 / XL 2010
    Posts
    1,671

    Re: Formula Excluding Hidden Cells

    Look into subtotal

    Function number from 101 till 111 will exclude hidden cells
    Function number from 1 till 11 will include hidden cells
    Last edited by rwgrietveld; 04-08-2010 at 06:55 AM.
    Looking for great solutions but hate waiting?
    Seach this Forum through Google

    www.Google.com
    (e.g. +multiple +IF site:excelforum.com/excel-general/ )

    www.Google.com
    (e.g. +fill +combobox site:excelforum.com/excel-programming/ )

    Ave,
    Ricardo

  3. #3
    Forum Expert dominicb's Avatar
    Join Date
    01-25-2005
    Location
    Lancashire, England
    MS-Off Ver
    MS Office 2000, 2003, 2007 & 2016 365
    Posts
    4,867

    Smile Re: Formula Excluding Hidden Cells

    Good morning Watson
    Quote Originally Posted by Watson View Post
    I am trying to figure out if a hidden group of cells can be excluded from a formula.
    Something like :
    =SUBTOTAL(109,A1:A50)
    should work fine. You don't state what version of Excel you are using - I seem to remember that SubTotal was beefed up after XL2000, if you're still using that version.

    HTH

    DominicB
    Please familiarise yourself with the rules before posting. You can find them here.

  4. #4
    Registered User
    Join Date
    03-08-2007
    Posts
    20

    Re: Formula Excluding Hidden Cells

    Sorry, I am using Excel 2007. Subtotal 102 works for me, as this is excluding the cells that I require. I use a few different functions, what with Count/sum etc. But Subtotal defo works.

    I can't seem to use the CountIF function however
    thanks guys
    Last edited by Watson; 04-08-2010 at 08:52 AM.

  5. #5
    Forum Expert dominicb's Avatar
    Join Date
    01-25-2005
    Location
    Lancashire, England
    MS-Off Ver
    MS Office 2000, 2003, 2007 & 2016 365
    Posts
    4,867

    Smile Re: Formula Excluding Hidden Cells

    Hi Watson
    Quote Originally Posted by Watson View Post
    I can't seem to use the CountIF function however
    thanks guys
    Can you explain exactly what you're trying to do with CountIf?

    DominicB

  6. #6
    Registered User
    Join Date
    03-08-2007
    Posts
    20

    Re: Formula Excluding Hidden Cells

    I have 2 cells that read from the same column. Basically in the column you can select from a drop down menu, and the drop down either says Yes or No. So I do a Count if to see How Many say Yes, and How many say No using

    =COUNTIF(Iceland!H7:H21,"Yes")
    =COUNTIF(Iceland!H7:H21,"No")

    Regards

    Colin

  7. #7
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Formula Excluding Hidden Cells

    The simplest solution in such instances is to use a 1/0 index to indicate visible status... eg - in a blank column on row 7 (we'll assume Z for sake of demo.)

    Z7: =SUBTOTAL(103,H7)
    copied down for all rows (to Z21)

    Your COUNTIF thus becomes a SUMIF

    =SUMIF($H$7:$H$21,"Yes",$Z$7:$Z$21)

    the above will thus identify all Yes' visible or not but the value in Z will only 1 where the row is visible (ie Yes/invisible -> 0)

    Alternatives involve SUMPRODUCT/SUBTOTAL & OFFSET... the above index is obviously simpler and may prove useful for other calcs also.

  8. #8
    Registered User
    Join Date
    03-08-2007
    Posts
    20

    Re: Formula Excluding Hidden Cells

    Confusing at 1st. But I understand it, and it works a treat! This should also help me with some of my other calculations also. Magic Donkey, thanks very much for this. It should cut down my monthly reports from around a few hours to a few minutes

    Thanks again

+ 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