+ Reply to Thread
Results 1 to 4 of 4

Counting Visible Columns

  1. #1
    Valued Forum Contributor
    Join Date
    04-24-2014
    Location
    United States
    MS-Off Ver
    Office 365 ProPlus
    Posts
    853

    Counting Visible Columns

    I'm trying to count the # of visible columns, and thought this could be done using the Subtotal function?

    When I use this, it returns the count of all the columns, and not just what is visible?

    Please Login or Register  to view this content.
    I tried with Subtotal 2, 3, 102, and 103 and all return the count of all of the columns.

    Is there another approach to get the count or sum of visible columns?

  2. #2
    Banned User!
    Join Date
    02-06-2020
    Location
    Iowa City, IA, USA
    MS-Off Ver
    2016 - 365 / 2007
    Posts
    2,014

    Re: Counting Visible Columns

    i doubt it. microsoft would not consider hidden cols when writing basic features like this. the average user is who they target. those are the buyers. I'm not sure why you're even saying that the function counts cols. it's not suppose to according to this:

    https://support.microsoft.com/en-us/...0-e478765b9939

    it's math only. but if what you say is true, then by some miracle there might be a ""hidden col"" attribute. but the article doesn't say it. it says this:
    The SUBTOTAL function is designed for columns of data, or vertical ranges. It is not designed for rows of data, or horizontal ranges. For example, when you subtotal a horizontal range using a function_num of 101 or greater, such as SUBTOTAL(109,B2:G2), hiding a column does not affect the subtotal. But, hiding a row in a subtotal of a vertical range does affect the subtotal.
    and this:
    The SUBTOTAL function ignores any rows that are not included in the result of a filter, no matter which function_num value you use.

  3. #3
    Valued Forum Contributor
    Join Date
    04-24-2014
    Location
    United States
    MS-Off Ver
    Office 365 ProPlus
    Posts
    853

    Re: Counting Visible Columns

    Yeah, unfortunately had to result to using a helper cell and getting the column widths to do it.

    Maybe one day, they will add a built in function for it.

  4. #4
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: Counting Visible Columns

    Why not use the column width greater than zero?

    https://exceljet.net/formula/count-visible-columns
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

+ 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. Counting Visible Rows Only
    By ACP454 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 05-14-2016, 12:46 PM
  2. VBA Visible Sheet Counting
    By JayEmTee91 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-26-2012, 11:41 AM
  3. [SOLVED] Counting visible cells only
    By ghostly1 in forum Excel General
    Replies: 5
    Last Post: 09-05-2012, 05:54 PM
  4. [SOLVED] Counting Visible Rows
    By jomili in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 02-09-2012, 11:17 AM
  5. Resize Visible Rows based only on Visible Columns text
    By Zimbo in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-22-2009, 10:55 AM
  6. counting only the visible rows
    By ashish727 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-05-2008, 09:06 AM
  7. Counting Only Visible Rows
    By Dom2012 in forum Excel General
    Replies: 5
    Last Post: 11-22-2006, 01:19 PM

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