+ Reply to Thread
Results 1 to 6 of 6

Adding criteria to array reference

  1. #1
    Registered User
    Join Date
    05-06-2015
    Location
    Canada
    MS-Off Ver
    MS Office Professional Plus 2010
    Posts
    9

    Adding criteria to array reference

    Hi

    I'm doing some production volume calculations in the format of a table, which has products as line items (rows), and years across the top (columns). These volumes change each year according to a "Type curve", of which there are several different ones. I have all these type curves laid out in a "TypeCurve" tab, and need to reference them into my main calculation tab where I have several other operations to perform on them, such as some cumulative production calcs.

    My question is - how to 'choose' the correct typecurve row to call from that tab into my sheet? There are three criteria by which the typecurves vary. I would normally use SUMIFS and add in three criteria, however the issue is that SUMIFS can't handle changing sizes of arrays. I've chopped out a piece of one of my equations to show an example of what I'm trying to do.

    SUM(TypeCurve!$I$32:I$32)

    As you can see, this is a cumulative calc which, when autofilled across a row in my calculation sheet, will reference a continuously growing array in the typecurve sheet. How do I get my equation to reference the correct row according to certain criteria?

    Cheers

  2. #2
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Adding criteria to array reference

    Something like this...

    Data Range
    A
    B
    C
    D
    E
    1
    2
    A
    37
    91
    53
    15
    3
    B
    22
    28
    15
    11
    4
    C
    15
    64
    56
    35
    5
    D
    72
    19
    42
    46
    6
    ------
    ------
    ------
    ------
    ------
    7
    C
    15
    79
    135
    170


    This formula entered in B7 and copied across:

    =SUM(INDEX($B2:B5,MATCH($A7,$A2:$A5,0),0))
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  3. #3
    Registered User
    Join Date
    05-06-2015
    Location
    Canada
    MS-Off Ver
    MS Office Professional Plus 2010
    Posts
    9

    Re: Adding criteria to array reference

    That works well - for a single criterion. Unfortunately I have three. I've included sample data below, apologies if it looks a little weird. I need to be able to choose the correct row according to TypeCurve, Length, and Product Type. Is it possible to 'stack' INDEX/MATCH functions or is there some other way?

    Please Login or Register  to view this content.

  4. #4
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Adding criteria to array reference

    Try this...

    Data Range
    A
    B
    C
    D
    E
    F
    1
    TypeCurve
    Length
    ProductType
    1
    2
    3
    2
    A
    1000
    WW
    2,817,601
    1,549,967
    993,711
    3
    A
    1000
    XX
    73,458
    15,861
    7,263
    4
    A
    2000
    WW
    3,874,202
    2,131,205
    1,366,352
    5
    A
    2000
    XX
    101,005
    21,810
    9,987
    6
    B
    1000
    WW
    1,531,165
    885,029
    610,824
    7
    B
    1000
    XX
    84,154
    27,114
    14,198
    8
    B
    2000
    WW
    2,105,351
    1,216,915
    839,883
    9
    B
    2000
    XX
    115,712
    37,282
    19,522
    10
    11
    A
    2000
    XX
    101005
    122815
    132802


    This formula entered in D11 and copied across:

    =SUMPRODUCT(($A2:$A9=$A11)*($B2:$B9=$B11)*($C2:$C9=$C11)*$D2:D9)

  5. #5
    Registered User
    Join Date
    05-06-2015
    Location
    Canada
    MS-Off Ver
    MS Office Professional Plus 2010
    Posts
    9

    Re: Adding criteria to array reference

    That seemed to do the trick, thanks!

  6. #6
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Adding criteria to array reference

    You're welcome. Thanks for the feedback!

+ 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. Criteria Array to the cell reference
    By vinod2802 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-03-2015, 05:55 AM
  2. [SOLVED] Adding to a new variable array from an existing array
    By Aussiexile in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 11-17-2014, 12:08 AM
  3. Replies: 0
    Last Post: 10-13-2012, 10:13 PM
  4. Adding an array of Dates to an Array of Times.
    By cummins in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-25-2011, 09:12 PM
  5. Replies: 2
    Last Post: 10-05-2011, 12:43 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