Excel Switch Case with Globbing
我有这样的编码值的一列:
60BM1
90CM2
120MM3
60CM1
120BM2
我想根据我创建的公式转换格式:
="F" & SWITCH(A1, "60*", "1", "90*", "2", "120*", "3") &
"T" & "." & SWITCH(A1, "*BM*", "1", "*CM*", "2", "*MM*", "3") &
"." & SWITCH(A1, "*1", "1", "*2", "2", "*3", "3")
生成新列的值,
F.1.T.1.1
F.2.T.2.2
F.3.T.3.3
F.1.T.2.1
F.3.T.1.2
但开关函数不起作用。可能是因为Wildstar *
s。
如何在Excel中执行这种基于模式的替代?
I have one column of encoded values like this:
60BM1
90CM2
120MM3
60CM1
120BM2
I want to convert the format according to this formula I created:
="F" & SWITCH(A1, "60*", "1", "90*", "2", "120*", "3") &
"T" & "." & SWITCH(A1, "*BM*", "1", "*CM*", "2", "*MM*", "3") &
"." & SWITCH(A1, "*1", "1", "*2", "2", "*3", "3")
to generate the new column's values
F.1.T.1.1
F.2.T.2.2
F.3.T.3.3
F.1.T.2.1
F.3.T.1.2
But the SWITCH functions don't work. Probably because of the wildstar *
s.
How can I perform this kind of pattern-based substitution in excel?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
相反使用匹配:
Use MATCH instead: