[英]Produce a value in one cell, if another cell contains a specific text in Excel
I have an excel file that has 1000 rows.我有一个包含 1000 行的 excel 文件。 I would like to insert certain values in a specific column if another column contains a certain text string.
如果另一列包含某个文本字符串,我想在特定列中插入某些值。
name value
hello
ok
sure
hello
Where ever there is the word, hello, I would like 33 for ok, I'd like 32 for sure, I'd like 34哪里有这个词,你好,我想要 33 好的,我想要 32 肯定的,我想要 34
Doing:正在做:
=IF(B5=$B$4,33,"")
This works, but how would I include the other criteria?这可行,但我将如何包含其他标准? The formula keeps saying I have too many arguments.
公式一直说我有太多的 arguments。
Any suggestion is appreciated.任何建议表示赞赏。
If your value is assigned liked hello=33
, ok=32
, sure=34
then you can use below formula.如果您的值被分配喜欢
hello=33
, ok=32
, sure=34
那么您可以使用下面的公式。
=INDEX({33,32,34},,MATCH(A2,{"hello","ok","sure"},0))
With Excel365
you can use XLOOKUP()
使用
Excel365
,您可以使用XLOOKUP()
=XLOOKUP(A2,{"hello","ok","sure"},{33,32,34})
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.