Search for Text in Cells in Excel


Searching for Text Fields in Cells

View Instructions for specific text search on youtube

We will introduce the search function: this function searches for the position for text within a field.

=Search("the text you want", cell name)

We Will search for the university abbreviations within email address.

Let say that we receive email from 3 different universities and we would like to know which university theses emails are from

=Search("uofa",F15)

The formula returns 7

Therefore, if the location is greater than 0, the text has been found.

So combining the search function with the If function then you will get

=if((search("uofa",F15)>0, "University of Alberta")

  • We will now enter text that it will not find.

=search("uofc", F15)

The formula returns the error message #value

To get it to search for more than one university we will add the iferror function

=Iferror(if((search("uofa",F15)>0, "University of Alberta"), ...then search for the next university

  • When combining formulas to display the names of several universities from an email,

  • The formula for searching for three universities would be:

    =IFERROR(IF(SEARCH("uofa",F15)>0,"University of Alberta"),
    IFERROR(IF(SEARCH("uofc",F15)>0,"Calgary University"),
    IFERROR(IF(SEARCH("au.ca",F15)>0,"Athabasca University"),"")))

  • The correct University indicated from the email address will be displayed