+ Reply to Thread
Results 1 to 6 of 6

using the match function with ranges

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    09-30-2015
    Location
    LA my baby
    MS-Off Ver
    2013
    Posts
    727

    using the match function with ranges

    Hello. I'm used to match with one criteria, how does something like match(A1:A4,A1:A4) work?

  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: using the match function with ranges

    Hi.

    First of all, that construction would require coercing (e.g. by some external, array-processing function) in order to produce the necessary array of returns. (Either that or it is entered as a multi-cell array formula over a (vertical) range of - in this case - four cells. However, I will assume that we are dealing with a single formula here for the sake of explanation.)

    In essence, though, MATCH is operating in precisely the same way as it always does. The difference is that, instead of returning just a single value, here you return an array of four values. Of course, that array cannot - unlike a single value - be returned to a single cell within the worksheet. Instead it is stored within Excel's memory, ready to be used as desired (by, as mentioned, some external function).

    So, for example, with A1:A4 containing "A", "B", "A", "C" respectively, the construction:

    =SUMPRODUCT(MATCH(A1:A4,A1:A4,0))

    (I chose SUMPRODUCT as a random example of a function which can act to coerce an array of returns.)

    will resolve to:

    =SUMPRODUCT({1;2;1;4})

    i.e. comprising an array whose entries are precisely those which we would have obtained had we calculated the four individual constructions:

    =MATCH(A1,A1:A4,0)

    i.e. 1

    =MATCH(A2,A1:A4,0)

    i.e. 2

    =MATCH(A3,A1:A4,0)

    i.e. 1

    =MATCH(A4,A1:A4,0)

    i.e. 4

    and then somehow combined these results into a single array.

    Regards
    Click * below if this answer helped

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

  3. #3
    Forum Contributor
    Join Date
    09-30-2015
    Location
    LA my baby
    MS-Off Ver
    2013
    Posts
    727

    Re: using the match function with ranges

    Hmmm, I sort of get it, but how can A3 be equal to 1? Doesn't it HAVE to be the third value in the match? A1,A2,A3,A4 match A1, A2, A3, A4, is just 1,2,3,4. I'm probably misunderstanding.

  4. #4
    Forum Expert Crooza's Avatar
    Join Date
    10-19-2013
    Location
    Hunter Valley, Australia
    MS-Off Ver
    Excel 2003 /7/10
    Posts
    2,082

    Re: using the match function with ranges

    Quote Originally Posted by stephme55 View Post
    Hmmm, I sort of get it, but how can A3 be equal to 1? Doesn't it HAVE to be the third value in the match? A1,A2,A3,A4 match A1, A2, A3, A4, is just 1,2,3,4. I'm probably misunderstanding.
    its finding the first match of A3. In this case A3 = A and the first match in the array {A,B,A,C} for an A is 1
    Happy with my advice? Click on the * reputation button below

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

    Re: using the match function with ranges

    MATCH always returns the relative position of the first instance of the lookup_value found within the range.

    Regards

  6. #6
    Forum Contributor
    Join Date
    09-30-2015
    Location
    LA my baby
    MS-Off Ver
    2013
    Posts
    727

    Re: using the match function with ranges

    Got it. Dnkas.

+ 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] index match function using a table and named ranges
    By jugdish in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 04-23-2015, 03:59 PM
  2. INDEX MATCH MATCH/OFFSET MATCH MATCH with named ranges
    By Andrew-Mark in forum Excel General
    Replies: 3
    Last Post: 02-27-2015, 10:56 PM
  3. [SOLVED] VBA Match Function with variables and number & alternating ranges
    By manofcheese in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 06-03-2014, 01:48 PM
  4. INDIRECT function not working inside MATCH with dynamic ranges
    By fotografer in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-26-2014, 02:09 AM
  5. Replies: 5
    Last Post: 10-26-2012, 02:21 PM
  6. Checking if ranges match exactly
    By tms_ in forum Excel General
    Replies: 1
    Last Post: 07-07-2010, 03:29 AM
  7. Replies: 3
    Last Post: 07-21-2005, 01:05 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