I have a single cell C68 that has the entry 12/34/56. I want cell C69 to add the 3 numbers and give the result, in this case 102 (12 + 34 + 56). What formula do I use?
I have a single cell C68 that has the entry 12/34/56. I want cell C69 to add the 3 numbers and give the result, in this case 102 (12 + 34 + 56). What formula do I use?
Try this in C69:
=LEFT(SUBSTITUTE(C68,"/",REPT(" ",100)),100)+MID(SUBSTITUTE(C68,"/",REPT(" ",100)),100,100)+RIGHT(SUBSTITUTE(C68,"/",REPT(" ",100)),100)
Hope this help.
Quang PT
This works perfectly when I have 3 numbers in a cell. Sometimes I have 4 or 2 numbers in a cell. Is there a way the formula would automatically adjust to that?
You could also use a UDF...
Add this to a new module in your workbook:
Then, in cell C69 type: =ADD(C68)![]()
Function Add(Rng As Range) As Variant Add = Evaluate(Application.Substitute(Rng, "/", "+")) End Function
- Moo
Last edited by Moo the Dog; 01-29-2013 at 01:41 PM. Reason: h/t to Andrew Poulsom
Did you try the proposed solution I posted? It will work no matter how many numbers are in the cell.
- Moo
Last edited by Moo the Dog; 01-29-2013 at 02:32 PM.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks