+ Reply to Thread
Results 1 to 6 of 6

horiziontal subtotal visible cells only

  1. #1
    Forum Expert JasperD's Avatar
    Join Date
    05-07-2013
    Location
    Netherlands
    MS-Off Ver
    Excel 2016
    Posts
    1,393

    horiziontal subtotal visible cells only

    Hi guys,

    If I use :

    subtotal(109, "A1:A10") then it will only sum the visible rows

    However, if I do
    subtotal(109, "A1:H1") then it ignores the visible or hidden columns are all counted....

    How can I do a subtotal horizontal on columns, ignoring the cells in hidden columns?

    Thanks!
    Please click the * below if this helps

  2. #2
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: horiziontal subtotal visible cells only

    Your best bet would be to use a User Defined Function that include volatility, so that it updates dynamically.

    Copy the code below, then in Excel hit Alt+F11. Go to Insert -> Module, and paste the code in there, and close that window.

    Now you have a new Function called SumVisible. Now =SumVisible(A1:H1) does what you need.

    Please Login or Register  to view this content.
    Make Mom proud: Add to my reputation if I helped out!

    Make the Moderators happy: Mark the Thread as Solved if your question was answered!

  3. #3
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: horiziontal subtotal visible cells only

    Or, if you can guarantee that no visible columns will have a width less than 0.5, you could put, in A2:

    =CELL("width",A1)

    and copy to the right. Then:

    =SUMIF(A2:H2,">=0.5",A1:H1)

    Regards
    Click * below if this answer helped

    Advanced Excel Techniques: http://excelxor.com/

  4. #4
    Forum Expert JasperD's Avatar
    Join Date
    05-07-2013
    Location
    Netherlands
    MS-Off Ver
    Excel 2016
    Posts
    1,393

    Re: horiziontal subtotal visible cells only

    Thanks guys, I used the custom function method

  5. #5
    Forum Expert JasperD's Avatar
    Join Date
    05-07-2013
    Location
    Netherlands
    MS-Off Ver
    Excel 2016
    Posts
    1,393

    Re: horiziontal subtotal visible cells only

    Wooops...

    application.volatile doesn't respond to hiding or showing columns...
    How to trigger that?

  6. #6
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: horiziontal subtotal visible cells only

    Hit F9 maybe?

+ 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. SUBTOTAL/SUMIF on autofilter visible cells only
    By crispben in forum Excel General
    Replies: 9
    Last Post: 10-23-2017, 08:39 PM
  2. Subtotal only Visible Column
    By rjbautista20 in forum Excel General
    Replies: 9
    Last Post: 01-11-2012, 04:08 AM
  3. subtotal only visible columns
    By nd4spd in forum Excel General
    Replies: 4
    Last Post: 08-01-2011, 11:47 AM
  4. Subtotal & Using Visible Cells Only
    By ability in forum Excel General
    Replies: 4
    Last Post: 10-27-2008, 06:23 AM
  5. Subtotal, Sumif Only Showing Visible
    By dprichard in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 12-12-2007, 08:21 AM

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