Results 1 to 28 of 28

NthMatch UDF as An Alternative to Array function...

Threaded View

  1. #18
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,710

    Re: NthMatch UDF as An Alternative to Array function...

    Pl see the file.
    Try this code also for speed test.
    Function NthMatch1(ByVal Lvalue As Variant, Lrange As Variant, Mnum As Variant)
        Mstr = "|" & Join(Application.Transpose(Lrange), "|") & "|"
        Start = 1
        
        For c = 1 To Mnum
        Found1 = InStr(Start, Mstr, "|" & Left(Lvalue, 1))
            If Found1 > 0 Then
            Start = Found1 + 1
                If Mid(Mstr, Start, Len(Lvalue) + 1) = Lvalue & "|" Then
                Start = Found1 + Len(Lvalue)
                Else
                c = c - 1
                End If
            
            End If
        Next
        
        Temp = Left(Mstr, Found1)
        NthMatch1 = Len(Temp) - Len(Replace(Temp, "|", ""))
            
    End Function
    Attached Files Attached Files
    Last edited by kvsrinivasamurthy; 01-10-2015 at 11:01 AM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Alternative to using an array formula for {=LARGE(IF(... function
    By Rabiah in forum Excel Formulas & Functions
    Replies: 28
    Last Post: 05-30-2014, 05:52 AM
  2. UDF Lookup function as an alternative to array functions & match/index
    By Andrew_Harris in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-15-2012, 09:34 PM
  3. [SOLVED] Non array alternative for percentile function
    By vandan_tanna in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-22-2012, 11:43 AM
  4. Alternative to an array formula.
    By RunHard in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 07-16-2009, 09:18 AM
  5. Array Formula Alternative
    By smninos in forum Excel General
    Replies: 10
    Last Post: 07-15-2009, 04:31 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