[英]Regex replace and split using Google SHeets formula
I have a sheet where I need to split the numbers and text on single cell to 2 columns我有一张表,我需要将单个单元格上的数字和文本拆分为 2 列
https://docs.google.com/spreadsheets/d/1ZaQmWCx2PH6Fhn3RVW9PKpnTv0ML9zAHWzmk3789b04/copy https://docs.google.com/spreadsheets/d/1ZaQmWCx2PH6Fhn3RVW9PKpnTv0ML9zAHWzmk3789b04/copy
Please note the data is in single cell and I need to split in 2 columns as shown in the image请注意数据在单个单元格中,我需要分成 2 列,如图所示
The expected outout is预期的输出是
I have tried with =REGEXREPLACE(A796,"[0-9]","")
我试过=REGEXREPLACE(A796,"[0-9]","")
You may use 2 formula in 2 different cells for this:为此,您可以在 2 个不同的单元格中使用 2 个公式:
Formula #1:公式1:
=REGEXREPLACE(A4,"[[:blank:]].*","")
This finds first space and removes everything after that so that we have only starting numbers left in the result.这会找到第一个空格并删除之后的所有内容,以便我们在结果中只剩下起始数字。
Formula #1:公式1:
=REGEXREPLACE(A4,"[0-9]+[[:blank:]]+","")
This matches starting 1+ digits followed by 1+ whitespace and removes it so that we only have text after starting numbers.这匹配起始 1+ 数字后跟 1+ 空格并将其删除,以便我们在起始数字之后只有文本。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.