+ Reply to Thread
Results 1 to 11 of 11

Getting a value from a string

  1. #1
    Forum Contributor
    Join Date
    08-24-2006
    Location
    Sevenoaks, Kent
    MS-Off Ver
    Office 365 ProPlus
    Posts
    459

    Getting a value from a string

    Good afternoon,

    I need to get the the value (3197.01) from this string below, can anyone help?
    The formant will always be the same so I need to pull out anything after Value: and Before Authorisation Code

    Please Login or Register  to view this content.
    Thanks in advance

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: Getting a value from a string

    Try this...
    =--MID(A1,7,9)
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Forum Contributor
    Join Date
    08-24-2006
    Location
    Sevenoaks, Kent
    MS-Off Ver
    Office 365 ProPlus
    Posts
    459

    Re: Getting a value from a string

    Sorry that did'nt work sorry

  4. #4
    Valued Forum Contributor
    Join Date
    04-09-2013
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2010
    Posts
    391

    Re: Getting a value from a string

    Considering text in J15 try:

    =MID(J15,8,FIND("Authorisation",J15)-FIND(": ",J15)-2)

  5. #5
    Forum Contributor
    Join Date
    08-24-2006
    Location
    Sevenoaks, Kent
    MS-Off Ver
    Office 365 ProPlus
    Posts
    459

    Re: Getting a value from a string

    Gave me the results of "ayment: 1"

  6. #6
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,878

    Re: Getting a value from a string

    Assume this is in cell A1
    Please Login or Register  to view this content.
    =MID(A1,FIND(":",A1)+1+1,FIND(" ",A1,FIND(":",A1)+2)-FIND(":",A1)-1)
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  7. #7
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: Getting a value from a string

    Quote Originally Posted by djfatboyfats View Post
    Sorry that did'nt work sorry
    what didnt work? what was the outcome?

    maybe this then
    =--MID(B3,FIND("@",SUBSTITUTE(A1," ","@",1),1)+1,(FIND("#",SUBSTITUTE(A1," ","#",2),1)-FIND("@",SUBSTITUTE(A1," ","@",1),1)-1))

  8. #8
    Valued Forum Contributor
    Join Date
    04-09-2013
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2010
    Posts
    391

    Re: Getting a value from a string

    If this is a continuous text in one cell try:

    =MID(J14,FIND("Value: ",J14)+7,FIND("Authorisation",J14)-FIND("Value: ",J14)-7)

  9. #9
    Forum Contributor
    Join Date
    08-24-2006
    Location
    Sevenoaks, Kent
    MS-Off Ver
    Office 365 ProPlus
    Posts
    459

    Re: Getting a value from a string

    alandsidman Your code worked however this is whats in cell A1
    Please Login or Register  to view this content.
    So the formula is pulling the 123456 number instead

  10. #10
    Forum Contributor
    Join Date
    08-24-2006
    Location
    Sevenoaks, Kent
    MS-Off Ver
    Office 365 ProPlus
    Posts
    459

    Re: Getting a value from a string

    misrasomendra Your latest code worked fine. Thanks everyone for your input

  11. #11
    Valued Forum Contributor
    Join Date
    04-09-2013
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2010
    Posts
    391

    Re: Getting a value from a string

    Thanks for the feedback.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. VBA Find Partial String in String Array and Output the Found String Array Value
    By scherich in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-02-2014, 11:20 AM
  2. [SOLVED] VBA for searching string in a column and copy rows depending on string in adjacent cell
    By xprakash in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 10-20-2013, 05:58 AM
  3. [SOLVED] IF range of cells contains string of text, return contents of cell where string is found
    By nobodyukno in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 07-03-2013, 09:56 AM
  4. Replies: 8
    Last Post: 08-07-2012, 10:15 AM
  5. [SOLVED] Translate form data into a text string and output that string into a preformated length
    By TJ Saulnier in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 03-19-2012, 03:58 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1