Forum Discussion
ronakbohra1994
Jun 10, 2020Copper Contributor
How to sum the numbers in a text string?
Hi If I have a text string in a cell below: "Apple 5 (+) Apple 10 (+) Apple 25 (+) Apple 20 (-)" And I would like to return the result of the sum of the numbers 5+10+25-20 "20" How can I do th...
peteryac60
Jun 10, 2020Iron Contributor
Attached is a simple example - you extract the number (using MID function) and convert to number (using NUMBERVALUE function). Then you can sum them.
Of course if you have many different types of texts (e.g. TOMATO 20) you will need to adjust the formula e.g. use FIND/SEARCH functions to identify the space before the number , then use MID/NUMBERVALUE as above.
Hope this is of some help.
Peter