Excel 中的子字符串
我有一组 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
kennytm 没有提供示例,因此以下是处理子字符串的方法:
假设单元格
A1
是Hello
。会返回
因为它说从字符 2,
e
开始,并返回 3 个字符。kennytm doesn't provide an example so here's how you do substrings:
Let's say cell
A1
isHello
.Would return
Because it says to start at character 2,
e
, and to return 3 characters.在 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)
另一种方法是使用替代函数。将“(”、“)”和“,”替换为空格。
例如
Another way you can do this is by using the substitute function. Substitute "(", ")" and "," with spaces.
e.g.
我相信我们可以从基础开始,达到预期的效果。
例如,我有一个情况是提取“/”后面的数据。给定的 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.
更新于 11/30/2022
通过新的 Excel 函数,您可以在单元格
C1
中使用以下内容作为A1
中的输入:以下是输出:
Update on 11/30/2022
With new excel functions, you can use the following in cell
C1
for the input inA1
:Here is the output:
使用全部替换怎么样?
只需将括号中的 All 替换为空格即可。
和逗号空格。我认为你可以实现它。
What about using Replace all?
Just replace All on bracket to space.
And comma to space. And I think you can achieve it.