Substitute a "/" for a "+" and add numbers

jeffreybrown

Well-known Member
Joined
Jul 28, 2004
Messages
5,152
If have a cell with 13/11/4

How can I add these numbers?

I've tried =LEFT(D7,FIND("/",D7)-1)+MID(D7,FIND("/",D7)+1,1)+RIGHT(D7,FIND("/",D7)-2)

but can't get the mid part to find the 11; instead, it only finds the 1 which makes the answer 18 but should be 28.

Is there a way to use =SUBSTITUTE(D7,"/","+") and then sum.

Can I get some further direction and help here?
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
I would use

Code:
=LEFT(A1,FIND("/",A1)-1)+MID(A1,FIND("/",A1)+1,FIND("/",SUBSTITUTE(A1,"/","*",1))-FIND("/",A1)-1)+RIGHT(A1,LEN(A1)-FIND("/",SUBSTITUTE(A1,"/","*",1)))
 
Upvote 0
Hi,

There may be better ways..

I assume your data is in A1.

Select A1

Define SumString

Refers to: =EVALUATE("{"&SUBSTITUTE(Sheet1!$A1,"/",",")&"}")

In B1:

=SUM(SumString)
 
Upvote 0
Another option using Kris' method.

Select A1, define the name SumString as :

=EVALUATE(SUBSTITUTE(Sheet1!$A1,"/","+"))

In B1:

=SumString
 
Upvote 0
Thanks to all, all formula's work great. Seems PGC's method would be easisest (at least for me) to remember.
 
Upvote 0
Hello Jeff, Try also,

=SUMPRODUCT(--MID(SUBSTITUTE("/"&A1,"/",REPT(" ",50)),ROW(INDEX(A:A,1):INDEX(A:A,LEN(A1)-LEN(SUBSTITUTE(A1,"/",""))+1))*50,49))
 
Upvote 0
Hi Haseeb...this works great also.

Hi Biff...Yes I was kinda of wonding that since the Evaluate is pointing to a specific cell. It seems from what I can tell, it only works looking at the cell immediately to the left. Is this right?
 
Upvote 0

Forum statistics

Threads
1,224,552
Messages
6,179,487
Members
452,917
Latest member
MrsMSalt

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top