简体   繁体   English

使用单元格的值和另一个字符串的条件格式

[英]Conditional Formatting using the value of a cell and a text string from another

What I would like to do is format a range of cells based on whether their value is below a certain threshold (100%). 我想做的是根据其值是否低于某个阈值(100%)格式化一系列单元格。 However, I only want this to apply if a specific cell in that row has a specific string of text. 但是,我只想在该行中的特定单元格具有特定文本字符串的情况下应用此方法。

Basically, if A1 has "Joe - T" and A2 has "Sally", I want to type 90% into B1 and have it formatted (lets say it will be bolded and italicized). 基本上,如果A1的名称为“ Joe-T”,而A2的名称为“ Sally”,我想在B1中键入90%并对其进行格式化(可以说它会以粗体和斜体显示)。 However, I do not want this to occur if I type the same number into B2. 但是,我不希望在B2中键入相同的数字时发生这种情况。 Basically, I want to format the cell if it is <100% but only if there is the string " - T". 基本上,我要设置单元格的格式,如果它是<100%,但仅当字符串“-T”存在时。

I have tried =AND(A1:33=" - T",B1:B33<100%) and some variations on that to no avail. 我已经尝试过=AND(A1:33=" - T",B1:B33<100%)并对此进行了一些修改,但无济于事。

I do not know how to properly display a table, forgive me I am brand new. 我不知道如何正确显示表格,请原谅我是全新的。 Thank you 谢谢

  A        B
1 Joe - T  ***90%***

2 Sally    90%

This should work 这应该工作

=AND(B1<1,IFERROR(FIND(" - T",A1),0)>0)

It checks if B1 is smaller than 100% (1) and if the string in A1 contains " - T" 它检查B1是否小于100%(1),以及A1中的字符串是否包含“-T”

Use this formula for formatting cel B1. 使用此公式格式化cel B1。 Then copy down (formatting only) 然后复制下来(仅格式化)

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

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