简体   繁体   English

Excel 条件格式以识别时间值而非数值的值

[英]Excel conditional formatting to identify values that are time values not numeric values

I need to use conditional formatting to either: -我需要使用条件格式来: -

  1. Identify time values in a sheet which should only contain numeric values or识别工作表中的时间值,该时间值应仅包含数值或
  2. Identify any cells that aren't numeric values (not 100% on this as time values possibly stored in similar to numeric values).识别任何不是数值的单元格(不是 100% 的时间值,因为时间值可能以类似于数值的方式存储)。

I'm looking around and experimenting all morning but I can't nail it down.我整个上午都在环顾四周并进行试验,但我无法确定。

Any help much appreciated, thanks.非常感谢任何帮助,谢谢。

Edit: For reference, this answer does not answer my question, as I'm trying to identify cells that contain time values, rather than simple numeric values.编辑:作为参考, 这个答案没有回答我的问题,因为我试图识别包含时间值的单元格,而不是简单的数值。

If you use the following formula as a conditional formatting rule it will then highlight the cells that are time values.如果您使用以下公式作为条件格式规则,它将突出显示作为时间值的单元格。

=TIMEVALUE(TEXT(C3,"hh:mm:ss"))     

In testing I have had to create the rule on a cell that is already a number value and then apply it to every other cell as it was changing the format of time cells to their underlying number if done otherwise.在测试中,我必须在已经是数字值的单元格上创建规则,然后将其应用于每个其他单元格,因为如果不这样做,它会将时间单元格的格式更改为其基础数字。

Create a new conditional formatting rule for cell C3 with the above formula as the rule.以上述公式为规则,为单元格 C3 创建一个新的条件格式规则。

条件格式规则

Then when applied, right click the cell and copy, then select the range of cells you want to apply the format to and select Paste Special - formats.然后在应用时,右键单击单元格并复制,然后选择要应用格式的单元格范围,然后选择选择性粘贴 - 格式。

This should then hightlight any value that has a time format然后,这应该突出显示具有时间格式的任何值

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM