Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using Excel "IF" Statment To Filter Out Text Beginning Or Ending With A Certain Character

Tags:

excel

Working on the same project as before and I need to find a way to to write an "IF" statement that will search for words beginning with a "<" as well as words that end with a " \ ". I would like to conditionally highlight those cells with the value "IGNORE: HIDDEN FIELD".

I searched around and found that there is a SEARCH function in Excel but that doesn't seem to be what I'm looking for.

Is anyone aware of how to do this? "If a cell begins with a "<" or ends with a " \ " then blah blah blah".

like image 667
Ryan_C Avatar asked Sep 18 '14 15:09

Ryan_C


1 Answers

To match words that start with < and end with \, use

=IF(AND(LEFT(A1,1)="<",RIGHT(A1,1)="\"),TRUE,FALSE)

To match words that start with < and / or end with \, use

=IF(OR(LEFT(A1,1)="<",RIGHT(A1,1)="\"),TRUE,FALSE)

Cell A1 contains the word to test. This can form the basis of your conditional formatting test. If you want to display alternative text then replace TRUE and FALSE to suit personal taste, e.g. IGNORE: HIDDEN FIELD and A1 respectively.

like image 137
Bathsheba Avatar answered Oct 20 '22 20:10

Bathsheba