简体   繁体   English

如何基于Excel中另一列中的值替换字符串中的值

[英]how to replace value in a string based on value in another column in excel

enter image description here 在此处输入图片说明

I want to replace the 'AA' in column B with corresponding values in Column A. How can I achieve that. 我想用B列中的相应值替换B列中的“ AA”。如何实现这一点。 I am looking for following results: 我正在寻找以下结果:

Column A
Bill
Invoice

Column B
ABAACD EFAAGH
ABAACD EFAAGH


Result
ABBILLCD EFBILLGH
ABINVOICECD EFINVOICEGH

In cell C1 use this formula and copy it down: 在单元格C1中,使用以下公式并将其复制下来:

=SUBSTITUTE(B1,"AA",A1)

Check out the SUBSTITUTE function for more information. 请查看SUBSTITUTE功能以获取更多信息。

This answer was originally posted as a comment by @tigeravatar: feel free to repost this answer as your own, and leave me a comment so I'll delete this copy. 该答案最初是由@tigeravatar发布为评论的:请随时将其作为您自己的答案重新发布,并给我留下评论,以便删除此副本。 This kind of answer has been stipulated for questions with no answers, but issue solved in the comments . 对于没有答案的问题,已经规定了这种答案,但是在注释中解决了问题

暂无
暂无

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

相关问题 Excel-根据另一列中的值替换单元格值 - Excel - Replace cell value based on a value in another column 如何基于 Excel 中的另一个列值对列值应用限制 - How to apply restriction on a column value based on another column value in Excel 如何基于另一个列中的唯一值获取Excel列的值 - How to grab the value of an excel column based on a unique value in another column 如何在Excel中基于另一个列值连接一个列值? - How to concatenate a column value based on another column value in excel? 如何根据另一列中的值替换单元格值以进行状态更新? - How to replace cell value based on a value in another column for status update? 如何基于包含以分号分隔的字符串中的值的另一列对excel中的列进行分类 - How to categorise a column in excel based on another column that contains value in string separated by semicolons 如何基于Excel中的另一个列值计算列的值? - How to calculate the value of a column based on another column values in Excel? Excel VBA用另一个值替换列值? - Excel VBA to replace column values with another value? 如何根据包含带分隔符的字符串中的值的另一列对excel中的列进行分类; 其中string可以有两个单独的单词 - How to categorise a column in excel based on another column containing value in string with delimiter ; where string can have two separate words 如何基于另一列的值在Excel中创建条件 - How to create a condition in excel based in a value of another column
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM