简体   繁体   English

如果单元格包含(x,y或z),则允许另一个单元格显示其公式值

[英]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. 如果要搜索子字符串而不是检查整个单元格是否等于值,则可以使用ISNUMBERSEARCH ,如下所示。 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.

相关问题 Excel:如果单元格 1 包含 X 或 Y 或 Z,则单元格 2 应等于 W - Excel: if cell 1 contains X or Y or Z, then cell 2 should equal W 如果单元格1包含w,则单元格2应等于x,如果单元格1包含y,则单元格2应包含z - If cell 1 contains w cell 2 should equal x, if cell 1 contains y cell 2 should contain z 如何将包含公式的单元格的值复制到另一个单元格? - How to copy the value of a cell that contains a formula into another cell? 基于x,y乘以z单元格值填充单元格 - Populate cells based on x by y by z cell value 包含来自另一个单元格的值的条件格式文本的公式 - Formula to conditional formatting text that contains value from another cell VBA .formula = If()以Cell(x,y)作为动态参考 - VBA .formula= If() with Cell(x, y) as dynamic reference 根据另一个单元格值将公式写入单元格 - Write a formula into a cell depending on another cell value Excel 公式检查单元格是否包含“Y”,如果确实将单元格除以 2。如果单元格包含“N”,则执行 IFERROR VLOOKUP - Excel formula to check if a cell contains “Y”, if it does divide a cell by 2. If cell contains “N” then do a IFERROR VLOOKUP 仅当单元格 1 包含“x”且单元格 2 包含“y”时才将行复制到另一个工作表中 - Copy rows into another sheet only if the cells1 contains "x" and cell2 contains "y" 如果Cell为X,则在VBA Excel中的整个列上,右侧单元格的值将为Y. - If Cell is X then Value of the Cell to its right will be Y, across entire column in VBA Excel
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM