+ Reply to Thread
Results 1 to 3 of 3

Formula that finds the first and nearest to the beginning instance of a word

  1. #1
    Registered User
    Join Date
    07-17-2013
    Location
    miami, fl
    MS-Off Ver
    Excel 2016
    Posts
    31

    Formula that finds the first and nearest to the beginning instance of a word

    Hello,

    I need a formula that looks for an exact word in a column whose individual cells might contain one or multiple words, and returns the first cell that contains that word closest to the beginning of the cell.

    So for ex., if the word i'm looking for is dog, and

    column a is:
    House dog
    Dog tree

    -> then the formula would return dog tree, which is the first cell that contains the value dog in the most left positioning (the first word of the cell).

    Please see attached excel file for more info. Thanks in advance.

    beginning_Word_Example.xlsx

  2. #2
    Forum Contributor John Vergara's Avatar
    Join Date
    01-17-2022
    Location
    Colombia
    MS-Off Ver
    365
    Posts
    209

    Re: Formula that finds the first and nearest to the beginning instance of a word

    Hi daatr!

    One option could be:
    PHP Code: 
    =INDEX(A$2:A$6,MATCH(AGGREGATE(15,6,SEARCH(" "&C2&" "," "&A$2:A$6&" "),1),SEARCH(" "&C2&" "," "&A$2:A$6&" "),)) 
    Blessings!
    A out-of-context text is a pretext.
    Consider adding reputation points to all the people who help you with your question/problem.

  3. #3
    Registered User
    Join Date
    07-17-2013
    Location
    miami, fl
    MS-Off Ver
    Excel 2016
    Posts
    31

    Re: Formula that finds the first and nearest to the beginning instance of a word

    Quote Originally Posted by John Vergara View Post
    Hi daatr!

    One option could be:
    PHP Code: 
    =INDEX(A$2:A$6,MATCH(AGGREGATE(15,6,SEARCH(" "&C2&" "," "&A$2:A$6&" "),1),SEARCH(" "&C2&" "," "&A$2:A$6&" "),)) 
    Blessings!
    Perfect, that did it. Thank you very much.

+ 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] Hyperl;ink that reads a cell and finds a matching Word doc
    By jndipworm in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-17-2020, 10:29 AM
  2. Replies: 6
    Last Post: 10-18-2016, 08:15 AM
  3. Replies: 3
    Last Post: 08-14-2015, 12:37 AM
  4. Find in VBA finds first instance of similar object being searched but not exact object
    By xcelnovice101 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-14-2015, 01:10 PM
  5. How do you create a search engine that finds a row containing a certain word when searched
    By nathandavies in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-31-2014, 06:30 AM
  6. [SOLVED] Cut a word from the end, put it at the beginning?
    By Snaxx in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 02-25-2014, 12:14 AM
  7. [SOLVED] Macro to find a word and out a % in a cell when it finds it
    By mmurphy77 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-30-2013, 06:38 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