[英]If cell contains (x,y or z) allow for another cell to display its formula value
I have three columns "BF", "SF", and "LF" whose cells have theire own unique formulas. 我有三列“ BF”,“ SF”和“ LF”,它们的单元格具有各自独特的公式。 Currently, regardless of what is entered in column "Species" the BF, SF, and LF cells will compute and display their formula values. 当前,无论在“物种”列中输入什么,BF,SF和LF单元格都会计算并显示其公式值。
I need help in trying to assign the formula cells to only display their formula values if the "Species" column matches a certain criteria. 在尝试将公式单元格分配为仅在“种类”列匹配特定条件时显示其公式值时,我需要帮助。 . 。 . 。
Example: 例:
For the BF column I would like it to display it's formulas value ONLY if the "Species" column matches any of the following. 对于BF列,仅在“ Species”列与以下任何一项匹配时,我希望它显示其公式值。 . 。 .DF#1 GRN, DF#2 GRN, DF#1 GRN FOHC, Borate, Borate KDAT, ACQ, ACQ KDAT. .DF#1 GRN,DF#2 GRN,DF#1 GRN FOHC,硼酸盐,硼酸盐KDAT,ACQ,ACQ KDAT。 . 。 .Or possibly there is a way to say that if the cell contains DF or ACQ or Borate 或者可能有一种说法是,如果该单元格包含DF或ACQ或Borate
For the SF Column I would like it to display it's formulas value ONLY if the "Species" column matches any of the following. 对于SF列,我希望仅在“ Species”列与以下任何一项匹配时显示其公式值。 . 。 .OSB, OSB S1, CDX, CDX S1, ACX, CCX .OSB,OSB S1,CDX,CDX S1,ACX,CCX
Any help you can provide would be greatly appreciated. 您能提供的任何帮助将不胜感激。 Thank you for your time. 感谢您的时间。
因此,您想要另一个IF
语句,该语句带有LEN(A1)<>LEN(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A1,"DF",""),"ACQ",""),"Borate",""))
?
You simply need an IF statement with OR logic inside. 您只需要在其中包含OR逻辑的IF语句。 The following will display 100 if "DF#1 GRN" or "DF#2 GRN" is present in cell A2. 如果单元格A2中存在“ DF#1 GRN”或“ DF#2 GRN”,则将显示100。 If they are not, it will display nothing (""). 如果不是,它将不显示任何内容(“”)。 You just need to put your formula in place of the 100, and add all the cases you need to the OR() separated by a comma. 您只需要将公式替换为100,然后将所有需要的情况添加到用逗号分隔的OR()中即可。
=IF(OR(A2 = "DF#1 GRN", A2 = "DF#2 GRN"), 100, "")
If you want to search for substrings instead of checking if the entire cell is equal to a value, you can use ISNUMBER
and SEARCH
as seen below. 如果要搜索子字符串而不是检查整个单元格是否等于值,则可以使用ISNUMBER
和SEARCH
,如下所示。 This will check if either "DF" or "Bo" exists in cell A2 and print either 100 or nothing based on that. 这将检查单元格A2中是否存在“ DF”或“ Bo”,并根据该结果打印100或不打印任何内容。
=IF(OR(ISNUMBER(SEARCH("DF", A2)), ISNUMBER(SEARCH("Bo", A2))), 100, "")
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.