简体   繁体   English

如何根据特定单元格中是否存在单词将一个单元格的值替换为另一个单元格的值

[英]How to replace the value of one cell with another based on whether a word exists in a specific cell

I have a basic question.我有一个基本问题。 I have a one column which represents a quantity.我有一列代表一个数量。 The cell to the right is a new column that will contain a word.右边的单元格是将包含一个词的新列。 I want to search cells in one column for the word and if it appears replace the word, let's say "foil" with the value of the cell to the left.我想在一列的单元格中搜索单词,如果它出现替换单词,让我们说“foil”与左边单元格的值。 A2 represents the cell A2, and I am checking B2. A2代表A2单元格,我勾选的是B2。 This formula is not working.这个公式不起作用。 I want the value of cell A2, not literally "A2"我想要单元格 A2 的值,而不是字面上的“A2”

=IFERROR(IF(SEARCH("*foil*",B2,1),"A2"),"0")

Thank you so much for your help.非常感谢你的帮助。 I really appreciate any and all help with this.我真的很感谢所有的帮助。

While you are using SEARCH() function you do not need to use wild card .当您使用SEARCH() function 时,您不需要使用wild card Remove double quote from "A2" so that formula can show data of A2 cell instead of text A2 ."A2"中删除双引号,以便公式可以显示A2单元格的数据而不是文本A2 See below...见下文...

=IFERROR(IF(SEARCH("Foil",B2,1),A2),0)

在此处输入图像描述

暂无
暂无

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

相关问题 根据另一个单元格的开头替换特定的单元格值 - Replace a specific cell value based on what another cell starts with VBA - 替换为在特定单元格中查找一个词有效,我如何找到一个词或另一个词? - VBA - Replace with find one word in a specific cell works, how do I find one word or another? 如何根据短语中的一个单词制作 IF 语句以返回另一个单元格的值 - how to make IF statement based on one word within a phrase to return another cell's value 如何根据另一列中的值替换单元格值以进行状态更新? - How to replace cell value based on a value in another column for status update? 自动基于另一个单元格替换单元格值-VBA - Automatically replace cell value based on another cell - VBA 根据另一个单元格值获取特定的单元格值 - Obtain specific cell-value based on another cell-value 有没有办法根据另一个工作表中的另一个特定值替换工作表中的单元格值 - Is there a way to replace a cell value in a sheet based on another specific value in another sheet 根据另一个单元格的值将数据从一个单元格复制到另一个单元格 - Copying data from one cell to another based on the value of another cell 基于另一个单元格突出显示一个单元格中的特定文本 - Highlight specific text in one cell based on another cell 根据另一个单元格中的值提取特定记录 - Pulling specific records based on value in another cell
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM