+ Reply to Thread
Results 1 to 4 of 4

Array formulae with different sized array, e.g. array-if() or somproduct-if()?

  1. #1
    Registered User
    Join Date
    03-14-2015
    Location
    Hamburg
    MS-Off Ver
    7
    Posts
    32

    Array formulae with different sized array, e.g. array-if() or somproduct-if()?

    Dear All,

    I am confused and honestly not so sure, whether Excel could achieve what I want, i.e. a sort of "array-if-formula":
    In the end I want to express a “sumproduct” of two arrays that do not have the same size in the first place. One is bigger than the other but once my criteria is matched they consist of exactly the same number of elements that need to be multiplied with with each other and summed up in the end.
    Please find in the illustrative example those arrays and different ways to achieve what I want. The first approach achieves my goal literally step by step and the two others are a little bit more straight to the point. You see, I can meet my goal with the help of intermediate step(s) but in the end I would like to get there within ONE step, even though that step might be a little more complicated.
    The current attempts to do this are in the red Frame: Unfortunaelty neither the use of index() nor vlookup() is sufficient within an array-formula as such, because it seems that these two formulae do not support the array-idea in general. Both of them do multiply the elements of the other smaller array with the first figure of the bigger one, only (pls compare: “X-Check of the approach in question”.

    I would appreciate your support, even if the final outcome might be that excel cannot do this...!

    Thanks a lot in advance and kind regards from Hamburg


    HLHans
    Attached Files Attached Files
    Please click * below in order to Add Reputation

  2. #2
    Valued Forum Contributor loginjmor's Avatar
    Join Date
    01-31-2013
    Location
    Cedar Rapids, Iowa
    MS-Off Ver
    Excel 2013
    Posts
    1,073

    Re: Array formulae with different sized array, e.g. array-if() or somproduct-if()?

    Hi -

    I don't think you can do what you're attempting with a formula. I think you would have to use VBA programming to do it in one cell.
    ____________________________________________
    If this has solved your problem, please edit the thread title to add the word [SOLVED] at the beginning. You can do this by
    -Go to the top of the first post
    -Select Thread Tools
    -Select Mark thread as Solved

    If I have been particularly helpful, please "bump" my reputation by pressing the small star in the lower left corner of my post.

  3. #3
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: Array formulae with different sized array, e.g. array-if() or somproduct-if()?

    This works with your sample, but would be too prone to error to be considered reliable for general use.

    The SUBTOTAL section of the formula effectively cleans up Array 1 by eliminating the elements not found in array 2, The remaining elements in Array 1 must be in the same order as in array 2, if the order is different, or any elements in Array 2 don't match up with Array 1 then the formula will fail.

    {=SUMPRODUCT(SUBTOTAL(9,OFFSET(B1,SMALL(IF(FREQUENCY(IF(A6:A14=TRANSPOSE(A26:A31),ROW(A6:A14)),ROW(A6:A14)),ROW(A6:A14)),ROW(A26:A31)-ROW(A26)+1)-1,0,1,1)),B26:B31)}

    For reliability, I would go with Approach 2, or, as previously suggested, a vba approach.
    Last edited by jason.b75; 05-20-2016 at 02:42 PM.

  4. #4
    Registered User
    Join Date
    03-14-2015
    Location
    Hamburg
    MS-Off Ver
    7
    Posts
    32

    Re: Array formulae with different sized array, e.g. array-if() or somproduct-if()?

    Jason, in case it didn't come through the frist time: THANKS A LOT!!! That helped a lot und is much appreciated. Kind regards from Hamburg
    HLHans

+ 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] Difference between these array formulae
    By millz in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-06-2015, 01:49 AM
  2. [SOLVED] Populate one array from another array and print new array as a range
    By Kaden265 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-07-2014, 07:52 AM
  3. [SOLVED] Quick Array question - Copy array to another array then resize?
    By mc84excel in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 05-02-2013, 01:17 AM
  4. Finding the Average of the Top 10% of a varying sized array
    By excelbunny in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-26-2012, 12:22 AM
  5. Dynamicaly sized array from single cell values
    By greenleaf9 in forum Excel General
    Replies: 3
    Last Post: 12-09-2009, 07:53 PM
  6. Array Formulae
    By kbsudhir in forum Excel General
    Replies: 1
    Last Post: 05-05-2009, 02:17 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