+ Reply to Thread
Results 1 to 9 of 9

Using "sum(if(iserror" with the Subtotal formula

  1. #1
    Registered User
    Join Date
    08-03-2009
    Location
    NY, NY
    MS-Off Ver
    Excel 2003
    Posts
    60

    Using "sum(if(iserror" with the Subtotal formula

    Does anybody know how I could combine the formulas below so that I can use the "Subtotal" feature without any "#N/A" errors messing-up the sum?

    =SUBTOTAL(9,LI15:LI18)

    =SUM(IF(ISERROR(LI15:LI18)," ",LI15:LI18))

    Thanks in advance.
    Last edited by taketwo; 01-17-2010 at 08:59 PM. Reason: Solved

  2. #2
    Forum Expert sweep's Avatar
    Join Date
    04-03-2007
    Location
    Great Sankey, Warrington, UK
    MS-Off Ver
    2003 / 2007 / 2010 / 2016 / 365
    Posts
    3,454

    Re: Using "sum(if(iserror" with the Subtotal formula

    Hi,

    Why not just use the array you've mentioned?

    =SUM(IF(ISERROR(LI15:LI18)," ",LI15:LI18)) confirmed with CRTL, SHIFT and ENTER?
    Rule 1: Never merge cells
    Rule 2: See rule 1

    "Tomorrow I'm going to be famous. All I need is a tennis racket and a hat".

  3. #3
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Using "sum(if(iserror" with the Subtotal formula

    Try:

    =SUM(IF(ISNUMBER(L15:L18),(SUBTOTAL(9,OFFSET(L15:L18,ROW(L15:L18)-MIN(ROW(L15:L18)),,1)))))

    confirmed with CTRL+SHIFT+ENTER
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  4. #4
    Forum Expert sweep's Avatar
    Join Date
    04-03-2007
    Location
    Great Sankey, Warrington, UK
    MS-Off Ver
    2003 / 2007 / 2010 / 2016 / 365
    Posts
    3,454

    Re: Using "sum(if(iserror" with the Subtotal formula

    Guys,

    Am I missing something here, won't subtotal(9, include hidden values the same as a regular formula?

    Dave

  5. #5
    Registered User
    Join Date
    08-03-2009
    Location
    NY, NY
    MS-Off Ver
    Excel 2003
    Posts
    60

    Re: Using "sum(if(iserror" with the Subtotal formula

    Thanks, NBVC - no clue how it works, but it does, so I won't question it.

    And Sweep, I'm with you, all of the information I've read seems to indicate that I should be using "Subtotal(10X" instead of "Subtotal(X", but it has always ignored the hidden values for me when I choose to Filter, so I'm not gonna try to fix what isn't broken.

    Maybe "Hidden" and "Filtered" are considered two different things? Not a clue.

  6. #6
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Using "sum(if(iserror" with the Subtotal formula

    Subtotal() excludes hidden values after filtering... I assume the OP is filtering...

    9 is hidden only by filtering
    109 is hidden by filtering and/or manually.

  7. #7
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Using "sum(if(iserror" with the Subtotal formula

    I basically took the concept described in the section:

    Count Visible Items in a Filtered List found here: http://www.contextures.com/xlFunctions04.html

    and adapted it to sum based on your criteria.

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

    Re: Using "sum(if(iserror" with the Subtotal formula

    The downside to this approach is of course the Volatility

    If you were working with bigger ranges you may find it makes sense to use adjacent cells to your range, eg:

    Please Login or Register  to view this content.
    then run your earlier (standard) SUBTOTAL against LJ11:LJ15 rather than LI11:LI15

  9. #9
    Registered User
    Join Date
    08-03-2009
    Location
    NY, NY
    MS-Off Ver
    Excel 2003
    Posts
    60

    Re: Using "sum(if(iserror" with the Subtotal formula

    Thanks for the help, everyone!

+ 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