+ Reply to Thread
Results 1 to 7 of 7

SUMPRODUCT and ARRAY with cell references/formulas

  1. #1
    Registered User
    Join Date
    05-03-2017
    Location
    San Francisco
    MS-Off Ver
    Mac 15.18
    Posts
    6

    SUMPRODUCT and ARRAY with cell references/formulas

    Hello all,
    I’d need some help with a formula related to calculating a commission based on dollars transacted.

    For the sake of the argument, there are three tiers of transacted dollars:

    Tier 1: First $10M
    Tier 2 : $10M-$25M
    Tier 3: > $25M

    Commission is % based. The % value is the sum of two % values in non-contiguous cells (B2 and B4 for tier 1, B6 and B8 for Tier 2, B10 and B12 for Tier 3).
    Unfortunately this is part of a large cost model and it is not possible to sum them up and have the total for each tier in one cell.

    Assuming the total transacted is in A1, I tried this formula to calculate the commission:
    =SUMPRODUCT(--((A1)>{0,10000000,25000000}),--((A1)-{0,10000000,25000000}),(B2+B4, B6+B8-(B2+B4), B10+B12-(B6+B8))

    but it doesn’t seem to work, as the third array is not recognized as such.

    Any idea on how to make it work?

    Thank you in advance for your help!!

  2. #2
    Forum Expert
    Join Date
    05-05-2015
    Location
    Waterlooville,England
    MS-Off Ver
    Office 2010
    Posts
    22,632

    Re: SUMPRODUCT and ARRAY with cell references/formulas

    It helps if there is data to work with.

    Attach a sample workbook. Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.

  3. #3
    Registered User
    Join Date
    05-03-2017
    Location
    San Francisco
    MS-Off Ver
    Mac 15.18
    Posts
    6

    Re: SUMPRODUCT and ARRAY with cell references/formulas

    Hello John,
    Thanks for your advice. I uploaded an example removing sensitive data.

    In row 15, I'd want to calculate the commission for each month. Unfortunately there must be something wrong with my formula as XLS doesn't even let me enter it. For this reason I commented it with '

    In row 19, I put the expected result, calculated manually for January.

    I hope my example is clearer. Thanks in advance for your help!

    federico
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    05-05-2015
    Location
    Waterlooville,England
    MS-Off Ver
    Office 2010
    Posts
    22,632

    Re: SUMPRODUCT and ARRAY with cell references/formulas

    See the attached:

    The only solution I could get to work was using the table in B16:J8.

    =SUMPRODUCT(--(C$12>=$B$16:$B$18),--(C$12-$B$16:$B$18),(C$16:C$18))

    SUMPRODUCT does not appear like a mixture of "data strings" and ranges nor did it like the construct of "Adding" cells as a substitute for a range.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    05-03-2017
    Location
    San Francisco
    MS-Off Ver
    Mac 15.18
    Posts
    6

    Re: SUMPRODUCT and ARRAY with cell references/formulas

    Thank you very much for looking into this, John!!
    ...I was afraid that might have been the case...

    federico

  6. #6
    Forum Moderator daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,676

    Re: SUMPRODUCT and ARRAY with cell references/formulas

    There are ways you can construct an array that will work in SUMPRODUCT, e.g. using CHOOSE function like this

    =SUMPRODUCT(--(C12>{0,10000000,25000000}),--(C12-{0,10000000,25000000}),CHOOSE({1,2,3},C2+C4,C5+C7-(C2+C4),C10+C8-(C7-C5)))
    Audere est facere

  7. #7
    Registered User
    Join Date
    05-03-2017
    Location
    San Francisco
    MS-Off Ver
    Mac 15.18
    Posts
    6

    Re: SUMPRODUCT and ARRAY with cell references/formulas

    Brilliant! Thanks!! I plugged it in my real spreadsheet and works flawlessly!

+ 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. [SOLVED] Array formulas using structured references?
    By lucazzo in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 08-26-2016, 08:55 AM
  2. Replies: 3
    Last Post: 11-05-2015, 09:09 PM
  3. sumproduct and array formulas into VBA
    By j.farr3ll in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-29-2013, 09:47 AM
  4. sumproduct and array formulas into VBA
    By j.farr3ll in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-29-2013, 07:38 AM
  5. SUMPRODUCT Vs ARRAY FORMULAS, which is the best and why?
    By e4excel in forum Excel Formulas & Functions
    Replies: 26
    Last Post: 03-30-2012, 11:40 AM
  6. Summing Array Formulas with Cell References
    By AnAnalyst in forum Excel General
    Replies: 2
    Last Post: 09-21-2010, 01:41 PM
  7. Relative References in Array Formulas - VBA
    By NBVC in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-02-2007, 12:01 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