Extracting Specifc  Text from Excel String (In, Out Values)

Posted on 2014-07-22
Last Modified: 2014-07-24

I copied some data from report and pasted into the excel the lines look something like this.

[Random Alphanumeric Chars of Varying Lengths] In=323 Out=69540 [Random Alphanumeric Chars of Varying Lengths].

What I am looking to do is extract the 'In' and 'Out' values into to separate columns.

I am using the following formula's but it doesn't work at all, all I am getting is #VALUE and I don't understand why.

=REPLACE(REPLACE(A1,FIND(" ",A1,FIND("In=",A1)),LEN(A1),""),1,FIND("In=",A1)+2,"")
=REPLACE(REPLACE(A1,FIND(" ",A1,FIND("Out=",A1)),LEN(A1),""),1,FIND("Out=",A1)+3,"")

Any ideas?
Question by:hellworld12345
    LVL 8

    Expert Comment

    I am getting values as per your formula 323 & 69540.

    I don't seem any fault.

    LVL 8

    Expert Comment

    just one try - change format to Text & then apply formula for that range.

    LVL 26

    Expert Comment

    Are  there are characters after Out=69540?
    LVL 27

    Accepted Solution

    I tested several random strings with " In-323 Out=69540 " inside them and the formulas work for me.  So long as there is a space before "In" and after the value for Out, it looks like it should work.  

    Maybe there are non-printable characters in the source string?  Try a TRIM and/or CLEAN function on it first and see if that resolves the issue.

    LVL 3

    Expert Comment

    Try this one with number format, if it is working, then change the text format.
    LVL 27

    Expert Comment

    by:Glenn Ray
    Could you provide a sample file with some of the lines you pasted?  Maybe we can replicate the issue and resolve.


    Author Closing Comment

    Cheers that was it, I had hyperlink into source column and that was causing the error.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    INDEX and MATCH can be used to great effect to replace HLOOKUP and VLOOKUP as it does not have the limitation of needing the data to be sorted so that the reference value is in the first column or row. It also has the ability to perform a bi-directi…
    Introduction This Article briefly covers methods of calculating the NPV and IRR variants in Excel as well as the limitations in calculating and interpreting IRR results. Paraphrasing Richard Shockley, author of my favourite finance reference tex…
    This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.
    This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.

    745 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    13 Experts available now in Live!

    Get 1:1 Help Now