[英]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.