+ Reply to Thread
Results 1 to 6 of 6

Add function to text string

  1. #1
    Registered User
    Join Date
    09-30-2013
    Location
    england
    MS-Off Ver
    Excel 2020
    Posts
    58

    Add function to text string

    Hello

    I would like add a function to a text string, the function is:

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

    The function needs to fit at the end of the string which reads:

    General arrangement of Signal Post (and the function goes here)

    Thanks in advance for your help.

  2. #2
    Forum Expert XLent's Avatar
    Join Date
    10-13-2010
    Location
    Northumberland, UK
    MS-Off Ver
    various
    Posts
    2,704

    Re: Add function to text string

    you just need to encase your string within quotations and concatenate (c/o & or CONCATENATE function)

    an alternative, using the ampersand approach but with a SUBSTITUTE approach to retrieve 2nd element in hyphen delimited string (A2)

    ="General arrangement of Signal Post "&TRIM(MID(SUBSTITUTE(A2,"-",REPT(" ",255)),255,255))

  3. #3
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.84 for Mac MS 365
    Posts
    8,508

    Re: Add function to text string

    if this General arrange of signal post ... is in A2 and the formula '=MID(A2,FIND("-",A2)+1,FIND("-",A2,FIND("-",A2)+1)-FIND("-",A2)-1)
    note the single quote in front of it to prevent it from activating... then this in C2 should work for you... =A2&" "&B2
    or get rid of the space between with this =A2&B2 or if you want it enclosed in parens... =A2&" ("&B2&")"
    Make contributors happy, click on the "* Add Reputation" as a way to say thank you.
    Sam Capricci

  4. #4
    Registered User
    Join Date
    09-30-2013
    Location
    england
    MS-Off Ver
    Excel 2020
    Posts
    58

    Re: Add function to text string

    Hi
    Thanks for your help.
    If number 2222-01 is in cell a2 the output is GENERAL ARRANGEMENT OF SIGNAL POST01 THUS i NEED A SPAVE BETWEEN THE LAST WORD AND THE 01 NUMBER.

    Thanks Again.

  5. #5
    Forum Expert XLent's Avatar
    Join Date
    10-13-2010
    Location
    Northumberland, UK
    MS-Off Ver
    various
    Posts
    2,704

    Re: Add function to text string

    Hi, with above referenced value in A2, the formula per post 2 will return "General Arrangement of Signal Post 01" (note the trailing space in the string, prior to ampersand)

    if you want this in Upper Case then (without knowing variant content in A2) apply outer UPPER

    =UPPER("General arrangement of Signal Post "&TRIM(MID(SUBSTITUTE(A2,"-",REPT(" ",255)),255,255)))

  6. #6
    Registered User
    Join Date
    09-30-2013
    Location
    england
    MS-Off Ver
    Excel 2020
    Posts
    58

    Re: Add function to text string

    Thank you XLent, it works perfectly.

+ 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. [SOLVED] Using a Correct Function to find text in a column that contains text string
    By LSemmes in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 04-15-2020, 11:49 AM
  2. [SOLVED] How to use a text string as a function?
    By JerryFr in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-05-2017, 11:56 AM
  3. Advanced Split Function: Need to pull text string in quotes, within a text string
    By Zamboni in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-27-2013, 04:38 PM
  4. [SOLVED] Find partial text string within another text string return original text into cell.
    By mikey42979 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 06-17-2013, 02:58 PM
  5. MAX Function with Text String
    By Huskersippi in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 04-12-2013, 01:35 PM
  6. String function to get selective text from long string
    By MWHLFC in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-29-2011, 02:51 PM
  7. string function to get selective text from long string
    By MWHLFC in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-25-2011, 05:00 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