+ Reply to Thread
Results 1 to 9 of 9

Help with formula to match text

  1. #1
    Registered User
    Join Date
    01-25-2015
    Location
    Minneapolis, MN
    MS-Off Ver
    Windows 7
    Posts
    36

    Help with formula to match text

    Trying to figure out a formula to search the first row of text in column A for a match to the 'last name' in column b. If 'last name' from column b is included in the first row of text from column a, display a 'yes' in column d. If 'last name' from column b is not included in the first row of text from column a, display a 'no' in column d.

    See attached example of spread.

    Not sure if this 'search first row of text in a cell' can be accomplished with formula vs. VB.


    Thank you.
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,662

    Re: Help with formula to match text

    Please Login or Register  to view this content.
    * CHAR(10) =new line code
    Ben Van Johnson

  3. #3
    Registered User
    Join Date
    01-25-2015
    Location
    Minneapolis, MN
    MS-Off Ver
    Windows 7
    Posts
    36

    Re: Help with formula to match text

    Thank you. That worked really well. A follow up question after looking at my test data.

    I added a column for 'Email address' (column D). Is it possible to add an 'or' condition to your formula to identify if there is an email domain match?

    ie. first line of text in column A is: Entered on 10/09/2020 at 5:02:00 PM CDT (GMT-0500) by [email protected]:

    Email address is column D is: [email protected]

    Would expect a 'Yes' since testdomain is in first line of text in column A. Attached a new spread sample. Thanks again for helping.

  4. #4
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,461

    Re: Help with formula to match text

    No sample attached

  5. #5
    Registered User
    Join Date
    01-25-2015
    Location
    Minneapolis, MN
    MS-Off Ver
    Windows 7
    Posts
    36

    Re: Help with formula to match text

    Attaching new version
    Attached Files Attached Files

  6. #6
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,419

    Re: Help with formula to match text

    Try this:

    =IF(OR(ISNUMBER(SEARCH(MID(D2,SEARCH("@",D2)+1,255),LEFT(A2,FIND(CHAR(10),A2)))),ISNUMBER(SEARCH(B2,LEFT(A2,FIND(CHAR(10),A2))))),"Yes","No")
    Attached Files Attached Files
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

  7. #7
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,213

    Re: Help with formula to match text

    Please try

    =IF(COUNT(INDEX(SEARCH(MID(B2:D2,FIND({"",0,"@"},B2:D2),20),LEFT(A2,FIND(CHAR(10),A2))),)),"Yes","No")
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    01-25-2015
    Location
    Minneapolis, MN
    MS-Off Ver
    Windows 7
    Posts
    36

    Re: Help with formula to match text

    Thanks, that worked great. One last request. How can I return blank of A2 is blank? Currently, if I copy that formula down an entire column, it returns no even if no data is present in cells A:D.

  9. #9
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,662

    Re: Help with formula to match text

    =if(isblank(A2),"",IF(OR(ISNUMBER(SEARCH(MID(D2,SEARCH("@",D2)+1,255),LEFT(A2,FIND(CHAR(10),A2)))),ISNUMBER(SEARCH(B2,LEFT(A2,FIND(CHAR(10),A2))))),"Yes","No"))

    or
    =IF(ISBLANK(A2),"",IF(COUNT(INDEX(SEARCH(MID(B2:D2,FIND({"",0,"@"},B2:D2),20),LEFT(A2,FIND(CHAR(10),A2))),)),"Yes","No"))

    you could replace ISBLANK(A2) with IF(COUNTA(A2:D2)=0, ...
    Last edited by protonLeah; 12-06-2020 at 07:48 PM.

+ 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] Text match and text update formula.
    By Andy308 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 06-14-2019, 08:01 AM
  2. Creating INDEX MATCH MATCH formula based off text in cells
    By bbkdude in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 04-26-2017, 10:37 AM
  3. How to highlight formula text that does not match other text?
    By mrez in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-24-2015, 02:11 PM
  4. [SOLVED] match formula with text is not working
    By ammartino44 in forum Excel General
    Replies: 18
    Last Post: 05-01-2015, 08:36 PM
  5. [SOLVED] Formula to Match a text year against a =text(date,"yyyy") and return a 1 value
    By john dalton in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-14-2014, 10:16 AM
  6. [SOLVED] Match text then enter formula
    By ChrisXcel in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-30-2014, 08:09 PM
  7. Replies: 6
    Last Post: 06-08-2012, 06:54 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