简体   繁体   English

如何检查“某个单元格中的一个”? 在Excel中

[英]How to check “a in a certain cell”? in excel

I'm not sure if it's appropriate to ask questions about excel. 我不确定问关于excel的问题是否合适。 I just want to create an IF function in excel, and I want to test whether a certain cell contains "$." 我只想在excel中创建IF函数,并且要测试某个单元格是否包含“ $”。

For example, I want to say: =IF("$" is in cell $B$3, True, False). 例如,我想说:= IF(“ $”在单元格$ B $ 3中,是,是)。

I'm not used to excel, and was wondering if there is like "in" function for excel. 我不习惯excel,并且想知道excel是否具有“ in”功能。 Thank you. 谢谢。


Edit: Sorry, the question wasn't clear. 编辑:对不起,这个问题不清楚。 Can I test for the currency of a certain cell? 我可以测试某个单元格的货币吗? ie IF B12's currency is USD, return X. 例如,如果B12的货币是美元,则返回X。

Use this: 用这个:

=IF(CELL("format",B3)="C2","True","False")

You may need to test the cells in question to ensure that CELL("format",B3) returns C2 for you local settings, and change the test accordingly. 您可能需要测试相关单元格,以确保CELL("format",B3)为您的本地设置返回C2 ,并相应地更改测试。

在此处输入图片说明

you can use: 您可以使用:

=ISNUMBER(SEARCH("$",$B$3))

The "SEARCH("$",$B$3)" part will return an integer location for the "$" in the cell, or #VALUE! “ SEARCH(” $“,$ B $ 3)”部分将为单元格中的“ $”或#VALUE返回一个整数位置! if it doesn't find it. 如果找不到。

The "=ISNUMBER()" part just checks if SEARCH gave it a number or not. “ = ISNUMBER()”部分仅检查SEARCH是否给它提供了一个数字。

Hope that helps! 希望有帮助!

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

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