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?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
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.
FloraAuthor Commented:
it gives me error the formula cannot be entered
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...
C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

FloraAuthor Commented:
thanks Saurabh  but it does not work.

it results
-32114
-42
-254
-331


while it should result
-32114
-42
-2541
-3311
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)
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
FloraAuthor Commented:
attached is the sample workbook with the data in it
Book1.xlsx
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

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
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.