根据公式指定的格式

可以将 STYLE() 函数添加到单元格的现有公式中。例如,与 CURRENT 函数一起使用时,您可以根据其值来为单元格上色。对于公式 =...+STYLE(IF(CURRENT()>3; "Red"; "Green")),如果值大于 3,则为单元格应用单元格样式“红色”,否则将应用单元格样式“绿色”。

如果希望选定区域中的所有单元格都应用某个公式,您可以使用查找和替换对话框。

  1. 选出所有您需要的单元格。

  2. 选择菜单命令编辑 - 查找和替换

  3. For the Find term, enter: .*

    ".*" 是一种常规表达式,指代当前单元格中的内容。

  4. Enter the following formula in the Replace field: =&+STYLE(IF(CURRENT()>3;"Red";"Green"))

    The "&" symbol designates the current contents of the Find field. The line must begin with an equal sign, since it is a formula. It is assumed that the cell styles "Red" and "Green" already exist.

  5. 选中正则表达式仅在当前选定范围内字段。单击查找全部

    选择中所有带内容的单元格被突出显示。

  6. 单击打开