Hello Jasa,
Input in A1
20.10.10x5.15.25/
Paste into B1
Code:
=(LEN(LEFT(A1,SEARCH("x",A1)))-LEN(SUBSTITUTE(LEFT(A1,SEARCH("x",A1)),".",""))+1)*SUM(IF(MID("."&MID(A1,SEARCH("x",A1)+1,20),COLUMN(1:1),1)=".",--(0&MID(MID(A1,SEARCH("x",A1)+1,20),COLUMN(1:1),FIND(".",MID(SUBSTITUTE(A1,"/","."),SEARCH("x",A1)+1,20),COLUMN(1:1))-COLUMN(1:1)))))
click cell B1 and press all 3 of these keys; Control, Shift, and Enter
(this is what is meant by the CSE)
The result will be the expected 135.
Hope that helps.
Thank u so much for helping me. It works.
Someone wrote about VBA code for this. But I don't really understand. can u take a look at this one, please. Thank u so much
<table border="0" cellpadding="0" cellspacing="0" width="383"><colgroup><col style="mso-width-source:userset;mso-width-alt:14006;width:287pt" width="383"> </colgroup><tbody><tr style="height:16.5pt" height="22"> <td class="xl65" style="height:16.5pt;width:287pt" width="383" height="22">Function funnySum(vStr As String) As Long</td> </tr> <tr style="height:16.5pt" height="22"> <td class="xl65" style="height:16.5pt" height="22">Dim bArr() As Byte, conCnt As Long</td> </tr> <tr style="height:16.5pt" height="22"> <td class="xl65" style="height:16.5pt" height="22">Dim dotCnt As Long, isLeft As Boolean</td> </tr> <tr style="height:15.0pt" height="20"> <td class="xl66" style="height:15.0pt" height="20">
</td> </tr> <tr style="height:15.75pt" height="21"> <td class="xl65" style="height:15.75pt" height="21">If vStr = vbNullString Then Exit Function</td> </tr> <tr style="height:15.75pt" height="21"> <td class="xl65" style="height:15.75pt" height="21">bArr = Left(vStr, InStr(1, vStr, "/") - 1)</td> </tr> <tr style="height:15.0pt" height="20"> <td class="xl66" style="height:15.0pt" height="20">
</td> </tr> <tr style="height:15.75pt" height="21"> <td class="xl65" style="height:15.75pt" height="21">For i = UBound(bArr) - 1 To 0 Step -2</td> </tr> <tr style="height:15.75pt" height="21"> <td class="xl65" style="height:15.75pt" height="21"> If isLeft Then</td> </tr> <tr style="height:15.75pt" height="21"> <td class="xl65" style="height:15.75pt" height="21"> If bArr(i) < 47 Then dotCnt = dotCnt + 1</td> </tr> <tr style="height:15.75pt" height="21"> <td class="xl65" style="height:15.75pt" height="21"> Else</td> </tr> <tr style="height:15.75pt" height="21"> <td class="xl65" style="height:15.75pt" height="21"> If bArr(i) > 47 Then</td> </tr> <tr style="height:15.75pt" height="21"> <td class="xl65" style="height:15.75pt" height="21"> If bArr(i) < 58 Then</td> </tr> <tr style="height:15.75pt" height="21"> <td class="xl65" style="height:15.75pt" height="21"> funnySum = funnySum + (bArr(i) - 47) * 10 ^ conCnt</td> </tr> <tr style="height:15.75pt" height="21"> <td class="xl65" style="height:15.75pt" height="21"> conCnt = conCnt + 1</td> </tr> <tr style="height:15.75pt" height="21"> <td class="xl65" style="height:15.75pt" height="21"> ElseIf bArr(i) = 120 Then</td> </tr> <tr style="height:15.75pt" height="21"> <td class="xl65" style="height:15.75pt" height="21"> isLeft = True</td> </tr> <tr style="height:15.75pt" height="21"> <td class="xl65" style="height:15.75pt" height="21"> End If</td> </tr> <tr style="height:15.75pt" height="21"> <td class="xl65" style="height:15.75pt" height="21"> Else</td> </tr> <tr style="height:15.75pt" height="21"> <td class="xl65" style="height:15.75pt" height="21"> conCnt = 0</td> </tr> <tr style="height:15.75pt" height="21"> <td class="xl65" style="height:15.75pt" height="21"> End If</td> </tr> <tr style="height:15.75pt" height="21"> <td class="xl65" style="height:15.75pt" height="21"> End If</td> </tr> <tr style="height:15.75pt" height="21"> <td class="xl65" style="height:15.75pt" height="21">Next</td> </tr> </tbody></table>
<table border="0" cellpadding="0" cellspacing="0" width="383"><colgroup><col style="mso-width-source:userset;mso-width-alt:14006;width:287pt" width="383"> </colgroup><tbody><tr style="height:16.5pt" height="22"> <td class="xl63" style="height:16.5pt;width:287pt" width="383" height="22">
</td> </tr> <tr style="height:16.5pt" height="22"> <td class="xl63" style="height:16.5pt" height="22">
</td> </tr> <tr style="height:16.5pt" height="22"> <td class="xl63" style="height:16.5pt" height="22">
</td> </tr> <tr style="height:15.0pt" height="20"> <td class="xl64" style="height:15.0pt" height="20">
</td> </tr> <tr style="height:15.75pt" height="21"> <td class="xl63" style="height:15.75pt" height="21">
</td> </tr> <tr style="height:15.75pt" height="21"> <td class="xl63" style="height:15.75pt" height="21">
</td> </tr> <tr style="height:15.0pt" height="20"> <td class="xl64" style="height:15.0pt" height="20">
</td> </tr> <tr style="height:15.75pt" height="21"> <td class="xl63" style="height:15.75pt" height="21">
</td> </tr> <tr style="height:15.75pt" height="21"> <td class="xl63" style="height:15.75pt" height="21">
</td> </tr> <tr style="height:15.75pt" height="21"> <td class="xl63" style="height:15.75pt" height="21">
</td> </tr> <tr style="height:15.75pt" height="21"> <td class="xl63" style="height:15.75pt" height="21">
</td> </tr> <tr style="height:15.75pt" height="21"> <td class="xl63" style="height:15.75pt" height="21">
</td> </tr> <tr style="height:15.75pt" height="21"> <td class="xl63" style="height:15.75pt" height="21">
</td> </tr> <tr style="height:15.75pt" height="21"> <td class="xl63" style="height:15.75pt" height="21">
</td> </tr> <tr style="height:15.75pt" height="21"> <td class="xl63" style="height:15.75pt" height="21">
</td> </tr> <tr style="height:15.75pt" height="21"> <td class="xl63" style="height:15.75pt" height="21">
</td> </tr> <tr style="height:15.75pt" height="21"> <td class="xl63" style="height:15.75pt" height="21">
</td> </tr> <tr style="height:15.75pt" height="21"> <td class="xl63" style="height:15.75pt" height="21">
</td> </tr> <tr style="height:15.75pt" height="21"> <td class="xl63" style="height:15.75pt" height="21">
</td> </tr> <tr style="height:15.75pt" height="21"> <td class="xl63" style="height:15.75pt" height="21">
</td> </tr> <tr style="height:15.75pt" height="21"> <td class="xl63" style="height:15.75pt" height="21">
</td> </tr> <tr style="height:15.75pt" height="21"> <td class="xl63" style="height:15.75pt" height="21">
</td> </tr> <tr style="height:15.75pt" height="21"> <td class="xl63" style="height:15.75pt" height="21">
</td> </tr> </tbody></table>