extract negative value from a alphanumeric string

please see the attached file.

i have a data in column A and i need all the numbers proceeding with negative to be extracted in column B
plz check the example given2015-05-04-18-56-50-Microsoft-Excel---Bo
LVL 6
FloraAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

gplanaCommented:
Try this:

in B1 cell write this formula:

=Mid(A1,Find("-",A1),Find(" ",Mid(A1,Find("-",A1))) - Find("-",A1))

Then extend the formula on B1 to B5

Hope it helps. Regards.
0
FloraAuthor Commented:
it gives me error the formula cannot be entered
0
Saurabh Singh TeotiaCommented:
Use this formula in A2...

=MID(SUBSTITUTE(A2,"- ","-"),FIND("-",SUBSTITUTE(A2,"- ","-")),FIND(" ",SUBSTITUTE(A2,"- ",""),FIND("-",SUBSTITUTE(A2,"- ","-"))+1)-FIND("-",SUBSTITUTE(A2,"- ","-")))

Open in new window


Saurabh...
0
Cloud Class® Course: CompTIA Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

FloraAuthor Commented:
thanks Saurabh  but it does not work.

it results
-32114
-42
-254
-331


while it should result
-32114
-42
-2541
-3311
0
Missus Miss_SellaneusCommented:
Try this in B2 and copy down:

=LEFT(CONCATENATE(IF(IF(ISERR(FIND("-",A2)),0,FIND("-",A2))=0,"",MID(A2,IF(ISERR(FIND("-",A2)),0,FIND("-",A2)),100))," "),FIND(" ",CONCATENATE(IF(IF(ISERR(FIND("-",A2)),0,FIND("-",A2))=0,"",MID(A2,IF(ISERR(FIND("-",A2)),0,FIND("-",A2)),100))," "))-1)
0
FloraAuthor Commented:
thanks Missus

it worked up to the third one but failed in the last one , the result i got is the following

-32114
-42
-2541
-

it could not produce the -3311
0
FloraAuthor Commented:
attached is the sample workbook with the data in it
Book1.xlsx
0
Saurabh Singh TeotiaCommented:
You can use the following code...

=MID(SUBSTITUTE(A2,"- ","-"),FIND("-",SUBSTITUTE(A2,"- ","-")),FIND(" ",SUBSTITUTE(A2,"- ","-"),FIND("-",SUBSTITUTE(A2,"- ","-"))+1)-FIND("-",SUBSTITUTE(A2,"- ","-")))

Open in new window


Your workbook for your reference...

Saurabh...
Book1.xlsx
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
FloraAuthor Commented:
thank you very much
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Excel

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.