+ Reply to Thread
Results 1 to 6 of 6

SUMPRODUCT with a dynamic array or any alternative might help

  1. #1
    Registered User
    Join Date
    03-30-2020
    Location
    asuncion
    MS-Off Ver
    office 365
    Posts
    5

    SUMPRODUCT with a dynamic array or any alternative might help

    c1.jpg
    c2.jpg

    Dear All,

    I have a Loan Amortization program which is dynamic in nature. It takes inputs from users and expands according to the inputs.
    I have dragged the formula to about 400 rows below and according to the users inputs, the rows are populated and the rest are programmed to show "".

    This is where the problem is. In one column, I am using a SUMPRODUCT formula which is dependent on one of the columns where the formula is dragged to 400 rows below.

    Because some rows will be populated with the numeric values and the rest will show "" (blank) hence SUMPRODUCT gives 'VALUE' error.

    I was just hoping is there any way where to have a dynamic array for SUMPRODUCT which goes until the last numeric value in that column it is depending on?
    Or can anyone tell me any alternative?

    Any SUPPORT will be highly appreciated.

    Best Regards

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,686

    Re: SUMPRODUCT with a dynamic array or any alternative might help

    Welcome to the forum.

    Instructions telling you how to attach your sample, desensitised workbook are at the top of the page.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Forum Expert XLent's Avatar
    Join Date
    10-13-2010
    Location
    Northumberland, UK
    MS-Off Ver
    various
    Posts
    2,704

    Re: SUMPRODUCT with a dynamic array or any alternative might help

    As AliGW has stated, a sample file would help (as I suspect you can simplify your calculation, or make more efficient) however, in general terms:

    =SUMPRODUCT((A1:A10="x")*(B1:B10="y")*C1:C10)

    will, as you say, generate #VALUE! if any value in C1:C10 is non-numeric, e.g. "apple"

    to avoid this behaviour, and mimic likes of SUMIF (and ignore non-numerics), you should endeavour (wherever feasible) to split your "boolean" arrays from your "value" arrays

    e.g.: converting above to:

    =SUMPRODUCT((A1:A10="x")*(B1:B10="y"),C1:C10)

    note: no longer * the C1:C10 range

    in this instance the above will return the aggregate of numbers (stored as numbers) - and ignore other data types (e.g. "apple")

    for the above syntax to work however, the arrays must share same dimensions -- as is the case above - i.e. both arrays 10x1

    another alternative (illustrated quite regularly by likes of @Bo_Ry), but with a little more overhead, would be:

    =SUMPRODUCT((A1:A10="x")*(B1:B10="y")*N(+C1:D10))

    and in this instance, given explicit coercion, the dimension of the arrays can differ (as illustrate - e.g. C1:D10 so 10x1 * 10x2)

  4. #4
    Registered User
    Join Date
    03-30-2020
    Location
    asuncion
    MS-Off Ver
    office 365
    Posts
    5

    Re: SUMPRODUCT with a dynamic array or any alternative might help

    Dear XLent,

    Thank you so much for your quick response. I applied one of ur suggestions and my problem which I had been working on for 3 days, got solved.
    God bless you.

  5. #5
    Registered User
    Join Date
    03-30-2020
    Location
    asuncion
    MS-Off Ver
    office 365
    Posts
    5

    Re: SUMPRODUCT with a dynamic array or any alternative might help

    Dear AliGW,

    Apologies....next time will make sure to follow those.

  6. #6
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,686

    Re: SUMPRODUCT with a dynamic array or any alternative might help

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

+ 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. SUMPRODUCT/SUMIFS Dynamic array doesn't works
    By regoroes in forum Excel General
    Replies: 5
    Last Post: 01-04-2018, 03:01 AM
  2. Replace multiple SumProduct/Vlookup with a dynamic array of conditions
    By Faboolous in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 03-18-2016, 11:55 AM
  3. [SOLVED] Replace multiple SumProduct/Vlookup with a dynamic array of conditions
    By Faboolous in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-17-2016, 11:12 AM
  4. Replies: 6
    Last Post: 08-11-2014, 09:13 PM
  5. Replies: 10
    Last Post: 06-24-2014, 09:36 AM
  6. Sumproduct with dynamic array
    By benaw in forum Excel General
    Replies: 3
    Last Post: 10-18-2009, 07:24 PM
  7. Sumproduct - Alternative
    By Harlequin in forum Excel General
    Replies: 2
    Last Post: 08-09-2007, 12:52 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