发布网友 发布时间:2022-04-23 06:34
共3个回答
热心网友 时间:2023-10-05 12:33
'自定义公式-按ALT+F11-插入-模块-粘贴代码-将表格另存为启用宏的格式(xlsm)
Function 转换(a As String)
b = Split(a, "X")
For i = 0 To UBound(b)
c = c & "X" & Format(b(i) / 2.54, "0.00")
Next
转换 = Mid(c, 2)
End Function
热心网友 时间:2023-10-05 12:34
B2公式:
=TEXT(LEFT(SUBSTITUTE(A2,"X",REPT(" ",99)),99)/2.54,"0.00")
&"X"&TEXT(MID(SUBSTITUTE(A2,"X",REPT(" ",99)),99,99)/2.54,"0.00")
&"X"&TEXT(MID(SUBSTITUTE(A2,"X",REPT(" ",99)),199,99)/2.54,"0.00")
下拉
热心网友 时间:2023-10-05 12:34
你的Excel是2016以上的版本的话,操作起来很简单了,K2单元格的公式为:
=TEXTJOIN("*",,ROUND(MID(SUBSTITUTE(J2,"X",REPT(" ",100)),100*{1,2,3}-99,100)/2.54,2))
复制并下拉,即可。
若是想要直接核算出结果,则公式为:
=ROUND(EVALUATE(TEXTJOIN("*",,ROUND(MID(SUBSTITUTE(J2,"X",REPT(" ",100)),100*{1,2,3}-99,100)/2.54,2))),3)