+ Reply to Thread
Results 1 to 3 of 3

Array Formula only works if entered in more than one cell

  1. #1
    Valued Forum Contributor
    Join Date
    01-19-2012
    Location
    Barrington, IL
    MS-Off Ver
    Excel 2007/2010
    Posts
    1,211

    Array Formula only works if entered in more than one cell

    I've seen this happen once before (on a shortest formula challenge)

    I am working on a solution for http://www.excelforum.com/excel-form...h-vlookup.html

    Every solution I have come up with does the same thing, it will work only if array-entered into multiple cells at the same time.

    Formulas this holds true with are:
    =SUM(INDEX(F3:F23,MATCH(B3:B17,E3:E23,0))*C3:C17)
    =IF(NOT(B3:B17="-"),SUM(INDEX(F3:F23,MATCH(B3:B17,E3:E23,0))*C3:C17),"")
    =SUM(VLOOKUP(B3:B17,E3:G23,2,0)*C3:C17)



    Why is this? The formulas work perfectly, if entered into more than one cell (ANY number of cells). But do not return the right result when only entered into one.

    I think VLOOKUP's don't work well in array format but INDEX/MATCH should as far as I know?
    Last edited by Speshul; 09-08-2014 at 09:15 AM.
    You should hit F5, because chances are I've edited this post at least 5 times.
    Example of Array Formulas
    Quote Originally Posted by Jacc View Post
    Sorry, your description makes no sense. I just made some formula that looks interesting cause I had nothing else to do.
    Click the * below on any post that helped you.

  2. #2
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Array Formula only works if entered in more than one cell

    Hi Speshul.

    The results achieved using multiple-cell array-entry are each operating on a different, relative element within the array passed to it. That is how they are designed.

    That should not necessarily lead you to believe that the equivalent single-cell array formula will operate over all elements within that array.

    At least, not without a little extra coercion. See here for an overview:

    http://excelxor.com/2014/08/23/index...ray-of-values/

    It resolves mainly around returning an array using INDEX, though if you go through it all you'll see there's a VLOOKUP example as well.

    Regards
    Click * below if this answer helped

    Advanced Excel Techniques: http://excelxor.com/

  3. #3
    Valued Forum Contributor
    Join Date
    01-19-2012
    Location
    Barrington, IL
    MS-Off Ver
    Excel 2007/2010
    Posts
    1,211

    Re: Array Formula only works if entered in more than one cell

    It just feels like using the =SUM at the beginning should sum up all contents of the list of values in the array

    =INDEX(F3:F23,MATCH(B3:B17,E3:E23,0))*C3:C17 on the sheet in the linked thread returns a 900 which is correct, if you enter into multiple cells it returns {900, something, something...}. With that in mind, I would assume that putting the =SUM in front would result in 5000 in one cell, or an array of {5000;5000;5000} (5000 is just a number, i forget the actual answer to the thread).

    My understanding of what is going on is as follows;

    If I were to enter {1;2;3;4;5;6} into Column A,
    The formula =--(A1:A6=4) returns
    {0;0;0;1;0;0}
    Multiplied by ROW()
    {0;0;0;4;0;0}
    Then you would use a SUM to get
    {4;4;4;4;4;4}
    Which you can array-enter into a single cell to get the result of 4.

    However, with the above formulas, entering that same formula in one cell returns a 3.4, but putting it in two or more returns {4;4;4;4;4;4............} That is where my confusion lies. One cell entry returns a number that doesn't exist within the array, nor can it be calculated somehow by the values within the array, but multi-cell entry gives a perfect answer with no other alterations to the formula.

    This is more or less as far as my knowledge of array formulas lies, while that understanding can go a long way, I guess I am still missing something. I'll continue looking around. Thanks for the website link by the way, I might just try some of those challenges you post, very tricky looking stuff!
    Last edited by Speshul; 09-08-2014 at 02:22 PM.

+ 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] weekday() result used in an array formula doesn't work. Formula works if i type in date
    By aarco50 in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 06-25-2014, 03:25 PM
  2. [SOLVED] Array Formula works in one portion, but not after being altered and moved
    By kspeese in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-19-2013, 01:14 AM
  3. Array Formula works perfectly in Excel 2007 but don't work in GDoc
    By lati2008 in forum For Other Platforms(Mac, Google Docs, Mobile OS etc)
    Replies: 5
    Last Post: 08-27-2013, 07:51 AM
  4. Inserting an array formula with VBA FormulaArray property works strange enough
    By Tchesko in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-27-2012, 11:32 AM
  5. [SOLVED] Array formula returns blank in the cell where it is entered
    By stevepejza@gmail.com in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 07-27-2006, 11:30 AM

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