+ Reply to Thread
Results 1 to 2 of 2

Counta ignore hidden columns

  1. #1
    Registered User
    Join Date
    02-11-2014
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    27

    Counta ignore hidden columns

    Hi

    I need a formula which counts non blanks.

    My data range to count is H12:PG12 but some columns (which will include non blanks) are hidden.

    I need to count the non blanks but NOT include the hidden columns in my count.

    Any suggestions?

    Many thanks

    Jack

  2. #2
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: Counta ignore hidden columns

    I don't think that is very easy with formulas. You can use the subtotal function to avoid hidden cells but that only works going down (i.e. avoiding hidden rows), not going across (avoiding hidden columns).

    So I would think your options are:
    -Transpose your data to go down instead of across
    -Use a VBA solution like:
    Please Login or Register  to view this content.
    Press alt+f11 to open vba editor, click insert->module and copy and paste that code in, then in a cell on your spreadsheet put:
    =sum_visible(H12:PG12)

    edit: you will need to force recalculate using F9, although you could add something like:
    =sum_visible(H12:PG12)+now()*0
    but I still think it won't recalculate when unhiding a column. Only once you change a cell.

    edit 2:
    Having looked at google, the excellent PGC has previously suggested using =cell("width",A1) to return the width of the column and testing if this is above 0, so if you created a helper row with the cell widths and then used an if statement to remove the ones that were very small. Although you would still need to manually recalculate with this method.
    Last edited by ragulduy; 04-25-2014 at 10:20 AM.

+ 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: 0
    Last Post: 09-13-2012, 11:10 AM
  2. COUNTA Ignore Formulas
    By sinspawn56 in forum Excel General
    Replies: 1
    Last Post: 03-04-2010, 02:59 PM
  3. COUNTA Ignore cells to left
    By dborchardt in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-02-2006, 02:50 PM
  4. [SOLVED] how to ignore hidden cells with a countif
    By Lee in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 06:05 AM
  5. How to "ignore" hidden columns?
    By xpucto in forum Excel General
    Replies: 2
    Last Post: 05-26-2005, 09:08 AM

Tags for this Thread

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