Forum Discussion
Tse-Wei Chen
Aug 09, 2018Copper Contributor
How to sum the numbers in a text string?
Hi If I have a text string in a cell below: "Path 8.5+Metrocard 10" And I would like to return the result of the sum of the numbers 8.5+10 "18.5" (see attached image) How can I do that by using ...
Lorenzo Kim
Aug 10, 2018Bronze Contributor
Mr. Chen
I am attaching herewith a sample..
I hope it is what you need.
- Lorenzo KimAug 10, 2018Bronze Contributor
prev attached file is a draft.. attached herewith is the correct sample
sorry...
- Tse-Wei ChenAug 10, 2018Copper ContributorThanks!
Is there any possibility to extract the multi digits of a text string and return the sum of these digits in one cell?
Say the text string "Path 8.5+Metrocard 10" is in one cell, and I have thousand cells with similar description, that I can't manually separate the text string into multi string like "Path 8.5" and "Metrocard 10" and use the digit function.
Might need a way to extract the items in the text first? or there is a sophisticated way to do it in one step?
Thanks again- Lorenzo KimAug 10, 2018Bronze Contributor
Mr. Chen
pls find as attached the sample for you to test.
I hope that it is what you needed.
A rather simple approach (though not that simple at all - I got help from somewhere!)
A much better way is by VBA - this is way out of my league!
but there are many good MVP's here in the forum in case you needed one.
good luck!