+ Reply to Thread
Results 1 to 3 of 3

Need to sum all rows in a SUMPRODUCT nested array when condition cell is blank

  1. #1
    Registered User
    Join Date
    01-23-2019
    Location
    Salt Lake City
    MS-Off Ver
    Office 365 ProPlus
    Posts
    2

    Need to sum all rows in a SUMPRODUCT nested array when condition cell is blank

    Hi,

    I'm using SUMPRODUCT to sum a large number of rows based on 3 conditional columns with 3 inputs. When the conditional column value matches the input for that column, that row's value is included in the total. When the input cell is blank, I want all rows to be included for that condition (i.e. the array that is created for that condition should contain all "1"s).

    I can't figure out how to force the array to be all "1" when the input cell is blank however. I've read some answers where people suggest an IF statement that checks of the input cell is blank, just do a sum on the entire column of numbers; if it is not blank, use SUMIFS or SUMPRODUCT to apply the conditions. This works fine for a single condition, but not for 3 conditions (you would need 8 nested IF statements and corresponding SUMPRODUCT statements).

    Is there an easier way to force the array associated with each condition to populate with all "1"s if the condition input cell is blank?

    Thanks in advance for any advice you can offer.

  2. #2
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    7,199

    Re: Need to sum all rows in a SUMPRODUCT nested array when condition cell is blank

    I illutrate with following info:
    Data in A2:D12
    Input in G2:I2
    Normally, sumproduct:

    =SUMPRODUCT(($A$2:$A$12=G2)*($B$2:$B$12=H2)*($C$2:$C$12=I2)*$D$2:$D$12)

    Now, for example, C2:C12=I2 will be taken all if I2 is blank: remove that statement by: IF(I2="",ROW($A$2:$A$12)>0,$C$2:$C$12=I2) with ROW($A$2:$A$12)>0 is list of "1"

    Aply to all 3 condition, the formula become (array formula, confirmed by Ctrl-shift-enter):

    Please Login or Register  to view this content.
    Or , non-array (longer a liitle bit)

    Please Login or Register  to view this content.
    See attachment.
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    01-23-2019
    Location
    Salt Lake City
    MS-Off Ver
    Office 365 ProPlus
    Posts
    2

    Re: Need to sum all rows in a SUMPRODUCT nested array when condition cell is blank

    bebo021999 / Quant PT, your solution is exactly right. You are a genius. Thank you for taking the time to respond to my question!

+ 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: 19
    Last Post: 05-21-2019, 03:17 PM
  2. Replies: 4
    Last Post: 02-24-2017, 02:39 AM
  3. [SOLVED] Macro to use array to copy all rows to a new sheet if a cell is not blank not working
    By capson in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-05-2014, 01:13 AM
  4. Replies: 11
    Last Post: 06-19-2014, 09:34 AM
  5. Replies: 5
    Last Post: 03-13-2011, 05:34 PM
  6. sumproduct problem...one array only if cell non blank
    By flutterby21 in forum Excel General
    Replies: 7
    Last Post: 07-23-2010, 03:44 PM
  7. VLOOKUP CONDITION TO RETURN BLANK CELL WHERE LOOKUP VALUE IS NOT IN TABLE ARRAY
    By Scott Lolmaugh in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-09-2006, 07:10 PM

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