+ Reply to Thread
Results 1 to 3 of 3

Wildcard search within IF and LARGE / SMALL INDEX searches.

  1. #1
    Registered User
    Join Date
    06-03-2013
    Location
    ME, USA
    MS-Off Ver
    Excel 2010
    Posts
    2

    Wildcard search within IF and LARGE / SMALL INDEX searches.

    Hello all,

    First post here as I have finally run out of places to search.

    I am using a formula to lookup the largest (or kth largest/smallest) value on another sheet {entered as an array}:

    =INDEX(SHEET1!$H$2:$H$827, LARGE(IF($C1=SHEET1!$G$2:$G$827, ROW(SHEET1!$G$2:$G$827)-MIN(ROW(SHEET1!$G$2:$G$827))+1, ""), COLUMN($A$1)))

    I wanted to add a wildcard to the value being searched such as $C1&"*" as I've done with INDEX MATCH functions before but that didn't work (I assume because the IF function)and after searching forums arrived at this below, which still hasn't worked:

    =INDEX(SHEET1!$H$2:$H$827, LARGE(IF(ISNUMBER(SEARCH(SHEET1!$G$2:$G$827,$C1)), ROW(SHEET1!$G$2:$G$827)-MIN(ROW(SHEET1!$G$2:$G$827))+1, ""), COLUMN($A$1)))

    Any suggestion on adding a wild card to the cell being searched (C1) since the cells in Sheet1 col H have additional characters on the end? Help much appreciated.

  2. #2
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,733

    Re: Wildcard search within IF and LARGE / SMALL INDEX searches.

    SEARCH works for the text anywhere within the cell - your suggestion has the arguments the wrong way round within SEARCH function.

    .....but for text beginning with C1 use LEFT function like this:

    =INDEX(SHEET1!$H$2:$H$827, LARGE(IF($C1=LEFT(SHEET1!$G$2:$G$827,LEN($C1)), ROW(SHEET1!$G$2:$G$827)-MIN(ROW(SHEET1!$G$2:$G$827))+1, ""), COLUMN($A$1)))
    Audere est facere

  3. #3
    Registered User
    Join Date
    06-03-2013
    Location
    ME, USA
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Wildcard search within IF and LARGE / SMALL INDEX searches.

    Excellent, that works great. Impressive response time too. Thank you!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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