简体   繁体   English

如果另一个单元格包含 Excel 中的特定文本,则在一个单元格中生成一个值

[英]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=33ok=32sure=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.

相关问题 Excel - 如果单元格包含列表中的文本,则返回另一个单元格的值 - Excel - if cell contains text in a list then return value of another cell Excel-如果单元格包含特定文本 - Excel - If cell contains specific text 如果另一个单元格包含特定文本,Excel中是否可以显示某个单元格? - Is there a way in Excel to display a certain cell if another contains specific text? 如何将单元格文本与包含Excel中已有文本的另一个单元格合并? - How to join a cell text with another cell that contains text already in excel? Excel:如果单元格包含特定文本,则返回值 - Excel: Return value if cell contains a certain text VBA帮助-如果一个单元格包含特定值而另一个单元格具有日期? 而不是另一个单元格-删除整行 - VBA Help- If one cell contains a specific value AND another cell has a date ? than another cell- delete entire row 如果另一个单元格包含特定的文本字符串,则复制一个单元格 - Copy a cell if another cell contains a specific text string Excel:如果单元格包含特定值,则将某些文本放入新单元格中 - Excel : If cell contains certain value then put certain text in new cell 从一个Excel到另一个Excel逐个单元复制值 - Copying value cell by cell from one excel to another excel Excel IF公式使一个单元格具有数据而另一个单元格具有特定值 - Excel IF Formula varififying one cell has data and another cell has specific value
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM