+ Reply to Thread
Results 1 to 15 of 15

problems with MATCH worksheet function

Hybrid View

  1. #1
    Registered User
    Join Date
    11-10-2007
    Posts
    35

    problems with MATCH worksheet function

    MATCH("b",{"a","b","c","b"},0) returns 2

    how about if I would like to have the return result as 4 since I have another "b" within that same array?

    Help me out with this problem thanks.

  2. #2
    Forum Contributor
    Join Date
    02-28-2006
    Posts
    690
    If I understand you correctly, with one "b" in the array, you want the returned answer to be 2, and for 2 "b"'s, 4.

    So just multiply by 2

  3. #3
    Forum Contributor corinereyes's Avatar
    Join Date
    12-02-2003
    Location
    Philippines
    MS-Off Ver
    MS Excel 2016
    Posts
    520
    Hi shrooms,

    Not sure but try this formula:

    =MATCH("b",{"a","b","c","b"},0)+IF(SUM(IF({"a","b","c","b"}="b",1,0)) <= 1, SUM(IF({"a","b","c","b"}="b",1,0))-1, SUM(IF({"a","b","c","b"}="b",1,0)))
    you can change the criteria by changing the letters in the formula that are in red to suit your need.
    Corine

  4. #4
    Registered User
    Join Date
    11-10-2007
    Posts
    35
    Quote Originally Posted by robert111
    If I understand you correctly, with one "b" in the array, you want the returned answer to be 2, and for 2 "b"'s, 4.

    So just multiply by 2
    ermm.. what I meant is that I would like the MATCH function to trace my second matched token which is "b" at the 4th position of the array instead of the first matched token that is at the 2nd position.

  5. #5
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,695
    If the lookup value ["b"] is in A1 and range to search is D1:D4 then to find the position of the nth match

    =SMALL(IF(D1:D4=A1,ROW(D1:D4)-ROW(D1)+1),n)

    confirmed with CTRL+SHIFT+ENTER

  6. #6
    Registered User
    Join Date
    11-10-2007
    Posts
    35
    Because of the ctrl + shift + enter. im not able to apply that formulae into another formulae.. how may i bypass ctrl + shift + enter ?

    =INDEX(B:B,SMALL(IF(B2:B22=B6,ROW(B2:B22)-ROW(B2)+1),VALUE(X2)),0)

  7. #7
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,695
    Quote Originally Posted by shrooms
    how may i bypass ctrl + shift + enter ?
    I'm not sure you can, easily.

    Why can't you use CTRL+SHIFT+ENTER with the INDEX formula?

    Perhaps explain what you want to achieve, exactly

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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