问题
I am trying to format different columns of my excel sheet based on two conditions: if the cell does not contain the letter "u" or the letter "r" and if it is greater than a set number.
For example, if I have a column of data, I would want 0.3 highlighted because it is greater than the set number of 0.00834 and does not contain U or R. I don't want 0.0071U to be highlighted or 0.0056J.
Any help?
回答1:
- Select the cells/column(s) you want the conditional format applied
to (for this example I assume you use column
B:B) - Check which cell is active - the "white" cell in the blue selection. (I assume it's
B1) - Create a new conditional format Home -> Conditional formatting -> New Rule
- Select "Use a formula to determine which cells to format"
- Enter the following formula:
=AND(RIGHT(B1,1)<>"U",RIGHT(B1,1)<>"R",IF(ISNUMBER(B1),B1,VALUE(LEFT(B1,LEN(B1)-1)))>0.00834)
Make sure that theB1is your active cell from step 2. Also make sure that it is not using any$to fix row or column.
Note: The formula assumes that your cells contain either proper numbers - or number and a single letter at the end! - Set the format you wish in the Format dialog.
Done!
来源:https://stackoverflow.com/questions/21590407/excel-conditional-formatting-with-data