That does not add up the whole numbers, rather, it adds up all of the individual digits.
I posted the wrong formula (that was my specific test formula, not the generalized one meant to handle any number of items), here is the generalized one (as written, it works for cells containing up to 300 characters)...I cannot tell you if it will work on an Android phone or not, but this formula does work on an Excel worksheet (as long as your data always looks like shown... comma delimiter, number at the end of field with a space in front of it)...
=SUMPRODUCT(0+TRIM(RIGHT(SUBSTITUTE(TRIM(MID(SUBSTITUTE(","&A1,",",REPT(" ",200)),ROW(1:3)*200,200))," ",REPT(" ",200)),200)))
I posted the wrong formula (that was my specific test formula, not the generalized one meant to handle any number of items), here is the generalized one (as written, it works for cells containing up to 300 characters)...
=SUMPRODUCT(0+TRIM(RIGHT(SUBSTITUTE(TRIM(MID(SUBSTITUTE(","&A1,",",REPT(" ",300)),ROW(INDEX(A:A,1):INDEX(A:A,1+LEN(A1)-LEN(SUBSTITUTE(A1,",",""))))*300,300))," ",REPT(" ",300)),300)))
I posted the wrong formula (that was my specific test formula, not the generalized one meant to handle any number of items), here is the generalized one (as written, it works for cells containing up to 300 characters)...
=SUMPRODUCT(0+TRIM(RIGHT(SUBSTITUTE(TRIM(MID(SUBSTITUTE(","&A1,",",REPT(" ",300)),ROW(INDEX(A:A,1):INDEX(A:A,1+LEN(A1)-LEN(SUBSTITUTE(A1,",",""))))*300,300))," ",REPT(" ",300)),300)))
That does not add up the whole numbers, rather, it adds up all of the individual digits.
I posted the wrong formula (that was my specific test formula, not the generalized one meant to handle any number of items), here is the generalized one (as written, it works for cells containing up to 300 characters)...
=SUMPRODUCT(0+TRIM(RIGHT(SUBSTITUTE(TRIM(MID(SUBSTITUTE(","&A1,",",REPT(" ",300)),ROW(INDEX(A:A,1):INDEX(A:A,1+LEN(A1)-LEN(SUBSTITUTE(A1,",",""))))*300,300))," ",REPT(" ",300)),300)))
Here is a UDF (user defined function) that you can use...But how to calculate this:
2*1.0+1.5+2*2.5+4.0 if I have it in one cell
<tbody>
</tbody>
Function Calc(S As String) As Double
Application.Volatile
Calc = Evaluate(S)
End Function
Here is a UDF (user defined function) that you can use...
Code:Function Calc(S As String) As Double Application.Volatile Calc = Evaluate(S) End Function
Note: I made the function Volatile so that if you have cell references in the expression in the cell you pass into the function and you change the the value in the referenced cell, the function will recalculate automatically.
HOW TO INSTALL UDFs
------------------------------------
If you are new to UDFs, they are easy to install and use. To install it, simply press ALT+F11 to go into the VB editor and, once there, click Insert/Module on its menu bar, then copy/paste the above code into the code window that just opened up. That's it.... you are done. You can now use Calc just like it was a built-in Excel function. For example,
=Calc(A1)
If you are using XL2007 or above, make sure you save your file as an "Excel Macro-Enabled Workbook (*.xlsm) and answer the "do you want to enable macros" question as "yes" or "OK" (depending on the button label for your version of Excel) the next time you open your workbook.