+ Reply to Thread
Results 1 to 6 of 6

SUMPRODUCT using 2 criteria in the same column at random intervals

  1. #1
    Registered User
    Join Date
    07-06-2016
    Location
    Australia
    MS-Off Ver
    2010
    Posts
    46

    SUMPRODUCT using 2 criteria in the same column at random intervals

    Hi guys,

    I'm trying to use a sumproduct to multiply values adjacent to two criteria that are in the same column and that repeat at random intervals down the column.

    My formula: SUMPRODUCT($F$6:$F$16,($E$6:$E$16=J17)*($E$6:$E$16=I17))

    I am trying to make the sumproduct do the following: (100 x 5) + (200 x 7) + (400 x 3) = 3,100

    Please take a look at the worksheet attached which explains better what i'm trying to do. Any help would be appreciated

    Cheers

    Mike
    Attached Files Attached Files

  2. #2
    Forum Expert avk's Avatar
    Join Date
    07-12-2007
    Location
    India
    MS-Off Ver
    Microsoft Office 2013
    Posts
    3,223

    Re: SUMPRODUCT using 2 criteria in the same column at random intervals

    Try in "K17"
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    atul


    If my answer (or that of other members) has helped you, please say "Thanks" by clicking the Add Reputation button at the foot of one of their posts.

    Also: if your problem is solved, please take the time to mark your thread as SOLVED by going to the top of your first post, selecting "Thread Tools" and then "Mark thread as solved".

  3. #3
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,213

    Re: SUMPRODUCT using 2 criteria in the same column at random intervals

    Please try and press Ctrl+Shift+Enter
    =SUM(INDEX(F:F,N(IF(1,SMALL(IF(E6:E20=I17,ROW(F6:F20)),{1,2,3}))))*INDEX(F:F,N(IF(1,SMALL(IF(E6:E20=J17,ROW(F6:F20)),{1,2,3})))))

    Or below with Ctrl+Shift+Enter if more than 3 sets of data

    =SUM(INDEX(F:F,N(IF(1,SMALL(IF(E1:E999=I17,ROW(F1:F999)),ROW(INDIRECT("1:"&COUNTIF(E:E,I17)))))))*INDEX(F:F,N(IF(1,SMALL(IF(E1:E999=J17,ROW(F1:F999)),ROW(INDIRECT("1:"&COUNTIF(E:E,I17))))))))

  4. #4
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2405
    Posts
    13,430

    Re: SUMPRODUCT using 2 criteria in the same column at random intervals

    Try array entering this.

    If you aren’t familiar with array-entered formulas array enter means the formula must be committed from edit mode by simultaneously pressing and holding down Ctrl and Shift while hitting Enter.
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Edited to simplify formula.
    Last edited by FlameRetired; 10-15-2018 at 04:15 AM. Reason: simplify formula
    Dave

  5. #5
    Registered User
    Join Date
    07-06-2016
    Location
    Australia
    MS-Off Ver
    2010
    Posts
    46

    Re: SUMPRODUCT using 2 criteria in the same column at random intervals

    Thanks guys. My question, why can't a standard sumproduct work on this table? How would the table need to be changed to accommodate a simpler formula. All the formulas provided work however it would be difficult for someone else to maintain this workbook if they came across these more complicated formulas. Note - The first formula (above) is simple however would be very time consuming on a larger data set.

  6. #6
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2405
    Posts
    13,430

    Re: SUMPRODUCT using 2 criteria in the same column at random intervals

    You could do simple SUMPRODUCT if you are willing to restructure the tables into one with each Hectares & Machine $/Ha paired values on the same rows. Without that the random intervals are going to complicate things.

    A standard SUMPRODUCT needs to have identical numbers of rows. The table structures you have are irregular and you are wanting to multiply paired values that are offset from one another randomly. This can be resolved as avk has done with nested steps and some manual work or by calculations like with the SUBTOTAL/OFFSET scheme.

+ 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: 2
    Last Post: 03-14-2018, 07:16 AM
  2. Random sampling based on specific criteria from another column
    By symaxf in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-06-2016, 07:02 PM
  3. Return 3 values from column based on random value but with exlusion criteria
    By anxiolydiot in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 10-29-2015, 07:32 AM
  4. SUMProduct Intervals
    By Branno in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 11-14-2013, 06:38 AM
  5. Replies: 6
    Last Post: 08-04-2013, 11:53 AM
  6. Make a countdown sequence with random intervals
    By Orthobill13 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-12-2012, 09:38 AM
  7. Random selection with multiple column criteria
    By kleick in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-03-2009, 03:50 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