Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
243 views
in Technique[技术] by (71.8m points)

excel - Contains a string in a cell

I'm trying to do conditional highlighting in Excel that would highlight the entire row of a cell if the cell contains a string.

Say I would like to determine if the cell contains the word "done". The cell can contain such text and would still be able highlight the cell:

  1. done
  2. It is done
  3. abcdone
question from:https://stackoverflow.com/questions/65907051/contains-a-string-in-a-cell

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Here's my example data set:

enter image description here

The conditional formatting window looks like this:

The rule applies to =$A$2:$D$13 (entire data table except for the header row) The base formula used is =ISNUMBER(SEARCH(substring,text))

Don't forget to make an absolute reference to the cell containing the search word (substring). For the text, make sure the column has an absolute reference starting in the top-left corner of first data entry, and rows have a relative reference (this is already done in the formula shown above, but I'm just elaborating on it here in general in case you do something similar in the future)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...