+ Reply to Thread
Results 1 to 12 of 12

Finding partial text in cells (could be conditional formatting or formula)

  1. #1
    Registered User
    Join Date
    02-12-2013
    Location
    Connecticut
    MS-Off Ver
    Excel 2010
    Posts
    50

    Finding partial text in cells (could be conditional formatting or formula)

    Hi,

    I think it should be pretty easy, but I can't figure out a quick way of doing this. I want to find any matches (variations) of a text string in a data set.

    In the attached spreadsheet, there is no consistency in the Item names. I'm looking to find all the possible box names. If it has any combinations of "A-Box", "A Box", "abox", etc. or any other way that "a box" can be written, I want to know about it (in the spreadsheet, A2, A4, A6, A8, A10 would match that criteria). This could be done through Conditional Formatting of the Item column or through a lookup formula (I'm open to any suggestions).

    Please let me know of any your thoughts. Thank you in advance for your help,

    Yury

  2. #2
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,466

    Re: Finding partial text in cells (could be conditional formatting or formula)

    Use this as condition formating criteria:

    =ISNUMBER(SEARCH("abox",SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A2,"/",""),"-","")," ","")))
    Quang PT

  3. #3
    Forum Expert sourabhg98's Avatar
    Join Date
    10-22-2014
    Location
    New Delhi, India
    MS-Off Ver
    Excel 2007, 2013
    Posts
    1,899

    Re: Finding partial text in cells (could be conditional formatting or formula)

    Hello
    Yes you can do both the ways
    with formulas type in
    =IF(IFERROR(IFERROR(IFERROR(SEARCH("abox",A2),SEARCH("A-Box",A2)),SEARCH("A box",A2)),0)<>0,"Found","Not-found")
    This formula is non-case-sensitive

    You can further exapnd the formula for other criterias

    if it returns "found" the value is found.....

    For conditional formatting
    use this formula
    =IFERROR(IFERROR(IFERROR(SEARCH("abox",A2),SEARCH("A-Box",A2)),SEARCH("A box",A2)),0)<>0
    select your format


    Tell me if it works right….

    Hope it helps
    Do ask for any other query you may have…

    If you are satisfied then mark then PLEASE mark this thread as “SOLVED” (by going to thread tools at the top and clicking on “mark this thread as solved”) and you can just click on ADD REPUTATION below my post to say thanks...
    Regards
    Sourabh Gupta

  4. #4
    Registered User
    Join Date
    02-12-2013
    Location
    Connecticut
    MS-Off Ver
    Excel 2010
    Posts
    50

    Re: Finding partial text in cells (could be conditional formatting or formula)

    Hi bebo021999,

    Thank you very much for the formula. I want to make sure that I understand it, so that I can use it for other instances (with other text). I have a couple of questions:
    1) What is the "/" in your formula? I tried to search for this online, but couldn't find anything.
    2) I'm assuming that if there are other instances of "variations" of "abox", then I can just continue nesting the SUBSTITUTE formula of the all the different "variations". Is that correct?
    3) I'm assuming that this formula would also find an instance of "kindofabox", but not "the box". Is that correct?

    Thank you again. Please let me know if you can. All the best,

    Yury

  5. #5
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,466

    Re: Finding partial text in cells (could be conditional formatting or formula)

    1) Yes I assume that variation of "a/box"
    2) That is correct to continue nesting SUBSTITUTE for other "variation"
    3) Correct. it find all string "abox" in LOWER, UPPER case both

  6. #6
    Registered User
    Join Date
    02-12-2013
    Location
    Connecticut
    MS-Off Ver
    Excel 2010
    Posts
    50

    Re: Finding partial text in cells (could be conditional formatting or formula)

    Hi Sourabh,

    Thank you very much for your explanation. I want to make sure that I understand your formula exactly so that I can use it in other instances (using other text). I have a couple of clarifying questions:

    1) I'm assuming that if there are other instances of "variations" of "abox", then I can just continue nesting the IFERROR/SEARCH formulas of the all the different "variations". Is that correct?
    2) What is the reason for "<>0" (i.e. "it does not equals zero") at the end of your formula?
    3) If there are different types of separators within "abox", like "a-box", "a box", "a.box", "a*box", etc., can I use "a?box" in the formula instead, using the "?" as "any character" in the formula?

    Please let me know if you have a chance. Thank you in advance,

    Yury

  7. #7
    Registered User
    Join Date
    02-12-2013
    Location
    Connecticut
    MS-Off Ver
    Excel 2010
    Posts
    50

    Re: Finding partial text in cells (could be conditional formatting or formula)

    Quote Originally Posted by bebo021999 View Post
    1) Yes I assume that variation of "a/box"
    Thank you for the answers. For Answer 1, how does the formula know to add the "/" after the first character (i.e. to substitute the second character in the text string, not any other one". In other words, I understand that you're substituting the "/" with "" and other characters with "", but I can't see why the formula would substitute something between the first and second character (not between the second and third or third and forth).

    I'm sorry to not be getting this, but I want to make sure that I understand your logic to help me with other instances.

    Thank you again, Yury

  8. #8
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,466

    Re: Finding partial text in cells (could be conditional formatting or formula)

    I am searching for "a/box" and replace with "abox", not for "/" only

    " abc/def a/box" will become " abc/def abox"

  9. #9
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,466

    Re: Finding partial text in cells (could be conditional formatting or formula)

    Opp, sorry, you are right.

    shoulb be" SUBSTITUTE(A2,"a/box","abox")

  10. #10
    Registered User
    Join Date
    02-12-2013
    Location
    Connecticut
    MS-Off Ver
    Excel 2010
    Posts
    50

    Re: Finding partial text in cells (could be conditional formatting or formula)

    So should the formula be...

    =ISNUMBER(SEARCH("abox",SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A2,"a/box","abox"),"-","")," ",""))) OR Something else?

    Thank you for your help, Yury

  11. #11
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,466

    Re: Finding partial text in cells (could be conditional formatting or formula)

    Yes. Same with others like "a-box" into "abox"

  12. #12
    Forum Expert sourabhg98's Avatar
    Join Date
    10-22-2014
    Location
    New Delhi, India
    MS-Off Ver
    Excel 2007, 2013
    Posts
    1,899

    Re: Finding partial text in cells (could be conditional formatting or formula)

    Hello again
    1. yes continue nesting it further by using iferror...
    2. the reason behind<>0 is that if you see that last iferror in the formula the iferror value is zero.... so if all the conditions go wrong then a zero will be returned meaning means text string is not found..
    3. yes for other separators use the question mark like this...
    =IF(IFERROR(IFERROR(IFERROR(SEARCH("abox",A2),SEARCH("A?Box",A2)),SEARCH("A box",A2)),0)<>0,"Found","Not-found")
    Happy to Help

    How to upload excel workbooks at this forum - http://www.excelforum.com/the-water-...his-forum.html

    "I don't get things easily, so please be precise and elaborate"

    If someone's post has helped you, thank by clicking on "Add Reputation" below the post.
    If your query is resolved please mark the thread as "Solved" from the "Thread Tools" above.

    Sourabh

+ 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] Conditional Formatting based on partial/specific text to highlight entire row
    By bizdevdfw in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 05-18-2016, 04:32 PM
  2. finding partial text in an index match formula
    By garyaw in forum Excel Formulas & Functions
    Replies: 22
    Last Post: 09-30-2015, 04:27 PM
  3. Need a 'conditional formatting' formula to highlight cells between dates/text
    By BigSean762 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-29-2014, 02:33 PM
  4. Formatting Cells with Date or Text Values in a Conditional Formatting Formula
    By Phil Hageman in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-15-2014, 09:36 AM
  5. [SOLVED] Conditional formatting formula based on text in two cells
    By lionrookie in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-08-2014, 12:50 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