简体   繁体   English

Excel:替换单元格的字符串值的一部分

[英]Excel: replace part of cell's string value

I have a large spreadsheet with a column called "Roles". 我有一个大型电子表格,其中包含一个名为“角色”的列。 In this columns are values like: 在此列中的值如下:

ROLES
Author
Author;
Publishing; Author;
Something Else; Author; Publishing

There are other columns where the word "Author" may exist. 还有其他列可能存在“作者”一词。

What I need to do is look for "Author" in my "Roles" column only, and replace it with "Authoring", without losing anything before or after it. 我需要做的是仅在我的“角色”列中查找“作者”,并将其替换为“创作”,而不会在其之前或之后丢失任何内容。 ie the end result should be: 即最终结果应该是:

ROLES
Authoring
Authoring;
Publishing; Authoring;
Something Else; Authoring; Publishing

I tried the FIND - and REPLACE -functions, but that replaced the entire cell value, not just a portion of it. 我尝试了FIND - 和REPLACE functions,但是它取代了整个单元格值,而不仅仅是它的一部分。

=IF(FIND("Author",[@Roles],1),REPLACE("Author",1,6,"Authoring"))

Can anyone help? 有人可以帮忙吗? I'd rather not us a VB solution, as I'm not familiar with how to do that, so hopefully there is a formula based way? 我宁愿不是我们的VB解决方案,因为我不熟悉如何做到这一点,所以希望有一个基于公式的方式?

what you're looking for is SUBSTITUTE: 您要找的是SUBSTITUTE:

=SUBSTITUTE(A2,"Author","Authoring")

Will substitute Author for Authoring without messing with everything else 将替换Author for Authoring而不会弄乱其他所有内容

What you need to do is as follows: 你需要做的是如下:

  1. List item 项目清单
  2. Select the entire column by clicking once on the corresponding letter or by simply selecting the cells with your mouse. 通过单击相应的字母或仅使用鼠标选择单元格来选择整个列。
  3. Press Ctrl+H. 按Ctrl + H.
  4. You are now in the "Find and Replace" dialog. 您现在位于“查找和替换”对话框中。 Write "Author" in the "Find what" text box. 在“查找内容”文本框中写下“作者”。
  5. Write "Authoring" in the "Replace with" text box. 在“替换为”文本框中写下“创作”。
  6. Click the "Replace All" button. 单击“全部替换”按钮。

That's it! 而已!

I know this is old but I had a similar need for this and I did not want to do the find and replace version. 我知道这是旧的,但我对此有类似的需求,我不想做查找和替换版本。 It turns out that you can nest the substitute method like so: 事实证明你可以像这样嵌套替代方法:

=SUBSTITUTE(SUBSTITUTE(F149, "a", " AM"), "p", " PM")

In my case, I am using excel to view a DBF file and however it was populated has times like this: 在我的情况下,我使用excel来查看DBF文件,但是它已经填充了这样的时间:

9:16a
2:22p

So I just made a new column and put that formula in it to convert it to the excel time format. 所以我刚刚制作了一个新专栏并将其放入其中,将其转换为excel时间格式。

You have a character = STQ8QGpaM4CU6149665!7084880820 , and you have a another column = 7084880820 . 你有一个字符= STQ8QGpaM4CU6149665!7084880820 ,你有另一列= 7084880820

If you want to get only this in excel using the formula: STQ8QGpaM4CU6149665! 如果你想使用公式只在excel中得到这个: STQ8QGpaM4CU6149665! , use this: , 用这个:

=REPLACE(H11,SEARCH(J11,H11),LEN(J11),"")

H11 is an old character and for starting number use search option then for no of character needs to replace use len option then replace to new character. H11是一个旧字符,并且对于起始号码使用搜索选项,然后对于没有字符需要替换使用len选项然后替换为新字符。 I am replacing this to blank. 我将此替换为空白。

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

相关问题 Excel:在单元格中重新格式化/替换字符串的一部分 - Excel: reformat/replace part of string in cell Excel:有没有办法替换单元格字符串的特定部分? - Excel: is there a way to replace a peculiar part of a cell string? Excel-查找并替换部分字符串但在同一单元格中? - Excel - Find & Replace Part of String But in Same Cell? 如何使用单元格的值(字符串)作为 Excel 中公式的一部分(不在宏中)? - How to use a cell's value (string) as part of a formula in Excel (not within a macro)? 在excel单元格中提取字符串的一部分 - Extract part of a string in excel cell Excel公式:如何将一个单元格的一部分与另一个单元格的一部分匹配并汇出匹配的单元格的值 - Excel Formula: How to match a part of one cell to the part of another and remit the matched cell's value Excel宏替换部分字符串 - Excel macro to replace part of string VBA / Excel在单元格中查找字符串以确定下一个单元格的值 - VBA/Excel Find a string in a cell to determine the next cell's value 使用VBA宏在一个单元格中查找并替换其下面的单元格值替换字符串的一部分 - Find and replace part of string in one cell with value of cell below it with VBA Macro Excel-用单元格中的值替换公式中的单元格链接 - Excel - Replace cell link in formula with value in cell
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM