excel conditional formatting with data

余生长醉 提交于 2019-12-14 04:11:15

问题


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:


  1. Select the cells/column(s) you want the conditional format applied to (for this example I assume you use column B:B)
  2. Check which cell is active - the "white" cell in the blue selection. (I assume it's B1)
  3. Create a new conditional format Home -> Conditional formatting -> New Rule
  4. Select "Use a formula to determine which cells to format"
  5. 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 the B1 is 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!

  6. Set the format you wish in the Format dialog.

Done!



来源:https://stackoverflow.com/questions/21590407/excel-conditional-formatting-with-data

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!