+ Reply to Thread
Results 1 to 3 of 3

Improve a formula by searching for a text string rather than individual words

  1. #1
    Forum Contributor
    Join Date
    02-09-2007
    Location
    UK
    MS-Off Ver
    2019 & 365
    Posts
    304

    Improve a formula by searching for a text string rather than individual words

    Can anyone help improve my formula?

    =IF($Q$1="TYRE",SUM(COUNTIFS(SOCo,$O2,RTS_code,{"TYREL","TYRE","TYR","TTYR","HTYRE"})),COUNTIFS(SOCo,$A28,RTS_code,IF(AND($Q$1="AIRCON",$O2="03"),"BAIR",$Q$1)))

    I would like to improve it by revising the section in bold.

    If possible, rather than search for the specific text "TYREL" or "TYRE" Etc, I would like it to find all occurrences where the letters "TYR" areas this is the common denominator in all the text strings, either at the beginning, middle or end.

    My concern is, for example, that text such as "PTYRE" could get added and my current formula would not include this in the results.

    Thanks in advance.

  2. #2
    Forum Guru
    Join Date
    04-23-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 365
    Posts
    2,463

    Re: Improve a formula by searching for a text string rather than individual words

    Since COUNTIF can use wildcards, I think this would count any cell containing the letters TYR next to each other (just change YourRange to your actual range reference)...

    COUNTIF(YourRange,"*TYR*")

  3. #3
    Forum Contributor
    Join Date
    02-09-2007
    Location
    UK
    MS-Off Ver
    2019 & 365
    Posts
    304

    Re: Improve a formula by searching for a text string rather than individual words

    Quote Originally Posted by Rick Rothstein View Post
    Since COUNTIF can use wildcards, I think this would count any cell containing the letters TYR next to each other (just change YourRange to your actual range reference)...

    COUNTIF(YourRange,"*TYR*")
    Perfect, thank you.

+ 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] Find matching words in a text string and return one of four words
    By alecoute in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-12-2018, 12:33 PM
  2. [SOLVED] Searching for a string of text within a longer string of text within an entire column
    By adam_d_john in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 09-29-2017, 07:09 PM
  3. Formula to separate string of text into single words
    By Nola111 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-29-2017, 06:53 PM
  4. How to extract diffrent words from text string with same formula
    By Zeb1980 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-21-2016, 07:50 AM
  5. Replies: 15
    Last Post: 10-12-2014, 08:53 AM
  6. [SOLVED] Searching a string of text using a formula
    By @MeDaveT in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 01-29-2013, 05:06 PM
  7. searching a string of text for multiple words
    By easty in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 12-10-2009, 04:20 AM

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