我的意思是例如在A1:123b中最好将123放到B,将“b”放到C列。有什么功能吗?
答案 0 :(得分:6)
如果数字始终在开头,那么,对于数字:
=LOOKUP(9.9E+307,--LEFT(A1,ROW(INDIRECT("1:20"))),LEFT(A1,ROW(INDIRECT("1:20"))))
和字母:
=MID(A1,LEN(LOOKUP(9.9E+307,--LEFT(A1,ROW(INDIRECT("1:20"))),LEFT(A1,ROW(INDIRECT("1:20")))))+1,20)
公式中的" 20"只需要一些大于您可能正在处理的最长字符串长度的数字。
答案 1 :(得分:1)
如果您只想获取值的数字部分(假设为A1),请使用数组公式(输入公式后的control-shift-enter):
=VALUE(LEFT(A1,MIN(IFERROR(SEARCH({"a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"},A1),LEN(A1)))-1))
该公式执行以下操作:
获取文本部分:
=RIGHT(A1,LEN(A1)+1-MIN(IFERROR(SEARCH({"a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"},A1),LEN(A1))))