+ Reply to Thread
Results 1 to 10 of 10

SUMPRODUCT including empty cells :(

Hybrid View

  1. #1
    Registered User
    Join Date
    09-20-2014
    Location
    London
    MS-Off Ver
    Excel 2013
    Posts
    98

    SUMPRODUCT including empty cells :(

    Not too experienced with advanced Excel, mainly cobbling information from the web - so please be gentle

    I have found a formula to report a count on a filtered range of cells on another worksheet (this is turned into a % by /by L10).

    This works great for reporting 0, +1, +2....+4 etc. However I need it to then report anything +5 or above.

    That is where things fall down as it reports 427%. I presume it is counting the empty cells


    =SUMPRODUCT(SUBTOTAL(3,OFFSET('Y4 R'!$AT$16,ROW('Y4 R'!$AT$16:$AT$120)-ROW('Y4 R'!$AT$16),0)),('Y4 R'!$AT$16:$AT$120>=5)+0)/'Y4 R'!L10


    How can I edit so it does not include empty cells

    Any ideas?

    Thank you in advance

  2. #2
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,711

    Re: SUMPRODUCT including empty cells :(

    Try adding another condition like this:

    =SUMPRODUCT(SUBTOTAL(3,OFFSET('Y4 R'!$AT$16,ROW('Y4 R'!$AT$16:$AT$120)-ROW('Y4 R'!$AT$16),0)),('Y4 R'!$AT$16:$AT$120>=5)+0,('Y4 R'!$AT$16:$AT$120<>"")+0)/'Y4 R'!L10
    Audere est facere

  3. #3
    Registered User
    Join Date
    09-20-2014
    Location
    London
    MS-Off Ver
    Excel 2013
    Posts
    98

    Re: SUMPRODUCT including empty cells :(

    Fanstastic - works a treat and also solves a further issue for me in the process

    Thank you

  4. #4
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,711

    Re: SUMPRODUCT including empty cells :(

    Thinking about this a little more, I presume the "empty" cells must actually have a text value in them otherwise SUBTOTAL wouldn't count them, you can probably get the right result without the extra condition, just by changing the 3 to a 2 in the SUBTOTAL function, that will then only include cells with a numeric value, i.e.

    =SUMPRODUCT(SUBTOTAL(2,OFFSET('Y4 R'!$AT$16,ROW('Y4 R'!$AT$16:$AT$120)-ROW('Y4 R'!$AT$16),0)),('Y4 R'!$AT$16:$AT$120>=5)+0)/'Y4 R'!L10

  5. #5
    Registered User
    Join Date
    09-20-2014
    Location
    London
    MS-Off Ver
    Excel 2013
    Posts
    98

    Re: SUMPRODUCT including empty cells :(

    Great

    Based on your correction I have tried to nudge the formula further ....I have tried to add <13 and >=9 and then >=24 and <27

    But reports 0 when there is actually 1 incidence....

    =SUMPRODUCT(SUBTOTAL(3,OFFSET('Y4 R'!$EA$16,ROW('Y4 R'!$P$16:$EA$120)-ROW('Y4 R'!$EA$16),0)),('Y4 R'!$EA$16:$EA$120<13)*('Y4 R'!$EA$16:$EA$120>=9)*('Y4 R'!$EC$16:$EC$120>=24))*('Y4 R'!$EC$16:$EC$120<27)

  6. #6
    Registered User
    Join Date
    09-20-2014
    Location
    London
    MS-Off Ver
    Excel 2013
    Posts
    98

    Re: SUMPRODUCT including empty cells :(

    Thanks for your help so far....I have now moved on to creating a progress matrices and am learning a lot along the way.

    I have tried to adapt your formula so that in this different report it will count when a one set of cells is between 13 and 9 AND when another set of cells is less than 15. However it doesn't work...where am I going wrong? I tried to put a , to differentiation between the first criteria and the second, but Excel corrects this to a *

    =SUMPRODUCT(SUBTOTAL(3,OFFSET('Y4 R'!$EA$16,ROW('Y4 R'!$P$16:$EA$120)-ROW('Y4 R'!$EA$16),0)),('Y4 R'!$EA$16:$EA$120<13)*('Y4 R'!$EA$16:$EA$120>=9))*('Y4 R'!$EC$16:$EC$120<15)

  7. #7
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,711

    Re: SUMPRODUCT including empty cells :(

    You just have the parentheses wrong in that version - try this:

    =SUMPRODUCT(SUBTOTAL(3,OFFSET('Y4 R'!$EA$16,ROW('Y4 R'!$P$16:$EA$120)-ROW('Y4 R'!$EA$16),0)),('Y4 R'!$EA$16:$EA$120<13)*('Y4 R'!$EA$16:$EA$120>=9)*('Y4 R'!$EC$16:$EC$120<15))

  8. #8
    Registered User
    Join Date
    09-20-2014
    Location
    London
    MS-Off Ver
    Excel 2013
    Posts
    98

    Re: SUMPRODUCT including empty cells :(

    Sorry - school boy error

    I think I have been looking it so long I have become ))(( blind

    I owe you a pint!

    Thanks

  9. #9
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,711

    Re: SUMPRODUCT including empty cells :(

    Quote Originally Posted by dazbear View Post
    I owe you a pint!
    What time?

  10. #10
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,711

    Re: SUMPRODUCT including empty cells :(

    You have the same error as last time - each condition is surrounded by parentheses and then there's an extra closing parenthesis at the end to close the SUMPRODUCT formula, so it needs to be like this, with the double closing parentheses always at the end:

    =SUMPRODUCT(SUBTOTAL(3,OFFSET('Y4 R'!$EA$16,ROW('Y4 R'!$P$16:$EA$120)-ROW('Y4 R'!$EA$16),0)), ('Y4 R'!$EA$16:$EA$120<13) * ('Y4 R'!$EA$16:$EA$120>=9) * ('Y4 R'!$EC$16:$EC$120>=24) * ('Y4 R'!$EC$16:$EC$120<27) )

+ 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. Sorting including empty cells
    By khhandal in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-05-2014, 05:03 AM
  2. only including non-empty cells in the formula
    By jveeken in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-21-2014, 04:43 AM
  3. [SOLVED] Pick Random Value from a Range (not including empty Cells)
    By ghoneim in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-22-2013, 04:46 AM
  4. The rank of average ranks excluding empty cells but including their average.
    By Terminal45 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-21-2012, 03:44 AM
  5. Excel 2007 : Sorting including empty cells
    By Domesticus in forum Excel General
    Replies: 0
    Last Post: 03-01-2011, 05:20 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