Excel 中的子字符串

发布于 2024-08-30 12:50:02 字数 349 浏览 6 评论 0原文

我有一组 Excel 数据,如下所示。

R/V(208,0,32)   YR/V(255,156,0)         Y/V(255,217,0)
R/S(184,28,16)  YR/S(216,128,0)         Y/S(209,171,0)
R/B(255,88,80)  YR/B(255,168,40)    Y/B(255,216,40)

我想将每个单元格中的数据分开,如下所示。

R/V 208 0 32
R/S 184 28 16
R/B 255 88 80

我可以在这种情况下使用excel中的函数是什么。 先感谢您。

I have a set of data that shown below on excel.

R/V(208,0,32)   YR/V(255,156,0)         Y/V(255,217,0)
R/S(184,28,16)  YR/S(216,128,0)         Y/S(209,171,0)
R/B(255,88,80)  YR/B(255,168,40)    Y/B(255,216,40)

And I want to separate the data in each cell look like this.

R/V 208 0 32
R/S 184 28 16
R/B 255 88 80

what is the function in excel that I can use for this case.
Thank you in advance.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

酒解孤独 2024-09-06 12:50:02

kennytm 没有提供示例,因此以下是处理子字符串的方法:

=MID(text, start_num, char_num)

假设单元格 A1Hello

=MID(A1, 2, 3) 

会返回

ell

因为它说从字符 2,e 开始,并返回 3 个字符。

kennytm doesn't provide an example so here's how you do substrings:

=MID(text, start_num, char_num)

Let's say cell A1 is Hello.

=MID(A1, 2, 3) 

Would return

ell

Because it says to start at character 2, e, and to return 3 characters.

潇烟暮雨 2024-09-06 12:50:02

在 Excel 中,子字符串函数称为 MID函数,indexOf称为FIND 区分大小写的位置和 搜索功能,用于不区分大小写的位置。对于解析文本的第一部分 LEFT 功能 也可能有用。

在此处查看所有文本函数:文本函数(参考)

完整的工作表函数参考列表位于:

   Excel 函数(按类别)
   Excel函数(按字母顺序排列)

In Excel, the substring function is called MID function, and indexOf is called FIND for case-sensitive location and SEARCH function for non-case-sensitive location. For the first portion of your text parsing the LEFT function may also be useful.

See all the text functions here: Text Functions (reference).

Full worksheet function reference lists available at:

    Excel functions (by category)
    Excel functions (alphabetical)

流绪微梦 2024-09-06 12:50:02

另一种方法是使用替代函数。将“(”、“)”和“,”替换为空格。
例如

 =SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A1, "(", " "), ")", " "), ",", " ")

Another way you can do this is by using the substitute function. Substitute "(", ")" and "," with spaces.
e.g.

 =SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A1, "(", " "), ")", " "), ",", " ")
习ぎ惯性依靠 2024-09-06 12:50:02

我相信我们可以从基础开始,达到预期的效果。

例如,我有一个情况是提取“/”后面的数据。给定的 Excel 字段的值为 2rko6xyda14gdl7/VEERABABU%20MATCHA%20IN131621.jpg 。我只是想从斜杠符号后的“I5”单元格中提取文本。所以首先我想找到“/”符号在哪里(FIND(“/”,I5)。这给了我“/”的位置。然后我应该知道文本的长度,我可以通过 LEN(I5) 获得.so 总长度减去 "/" 的位置,即 LEN(I5)-(FIND("/",I5)) 。这将首先找到“/”位置,然后获取需要的总文本。提取的。
RIGHT 函数 RIGHT(I5,12) 将简单地提取从最右边的字符开始的最后 12 位数字的所有值。因此,我将上面的函数“LEN(I5)-(FIND("/",I5))”替换为 RIGHT 函数中的 12 个数字,以动态获取我需要在任何给定单元格中提取的字符数和我的解决方案如下所示

该方法是

=RIGHT(I5,LEN(I5)-(FIND("/",I5))) 会给我 VEERABABU%20MATTCHA%20IN131621.jpg 。我想我很清楚。

I believe we can start from basic to achieve desired result.

For example, I had a situation to extract data after "/". The given excel field had a value of 2rko6xyda14gdl7/VEERABABU%20MATCHA%20IN131621.jpg . I simply wanted to extract the text from "I5" cell after slash symbol. So firstly I want to find where "/" symbol is (FIND("/",I5). This gives me the position of "/". Then I should know the length of text, which i can get by LEN(I5).so total length minus the position of "/" . which is LEN(I5)-(FIND("/",I5)) . This will first find the "/" position and then get me the total text that needs to be extracted.
The RIGHT function is RIGHT(I5,12) will simply extract all the values of last 12 digits starting from right most character. So I will replace the above function "LEN(I5)-(FIND("/",I5))" for 12 number in the RIGHT function to get me dynamically the number of characters I need to extract in any given cell and my solution is presented as given below

The approach was

=RIGHT(I5,LEN(I5)-(FIND("/",I5))) will give me out as VEERABABU%20MATCHA%20IN131621.jpg . I think I am clear.

手心的温暖 2024-09-06 12:50:02

更新于 11/30/2022

通过新的 Excel 函数,您可以在单元格 C1 中使用以下内容作为 A1 中的输入:

=TEXTJOIN(" ",,TEXTSPLIT(A1,{"(",",",")"}))

以下是输出:
示例输出文件

Update on 11/30/2022

With new excel functions, you can use the following in cell C1 for the input in A1:

=TEXTJOIN(" ",,TEXTSPLIT(A1,{"(",",",")"}))

Here is the output:
sample output file

温暖的光 2024-09-06 12:50:02

使用全部替换怎么样?
只需将括号中的 All 替换为空格即可。
和逗号空格。我认为你可以实现它。

What about using Replace all?
Just replace All on bracket to space.
And comma to space. And I think you can achieve it.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文