+ Reply to Thread
Results 1 to 5 of 5

Search for specific characters in specific positions in a cell then return a value

  1. #1
    Registered User
    Join Date
    08-15-2013
    Location
    Peterborough, England
    MS-Off Ver
    Excel 2010
    Posts
    6

    Search for specific characters in specific positions in a cell then return a value

    Hello ...

    How do i search for specific characters in specific positions in a cell then return a value ?

    E.g ... a cell contains a 10 character code ... if the first 2 characters = AB then return "text" and if the 5th character = C then return "text" and if the 9th character = D then return "text"
    The returned "text" needs to be concatenated into one cell to give a converted value

    I hope this makes sense and that you can help as ive looked online and not found anything of any use

    Thanks

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,724

    Re: Search for specific characters in specific positions in a cell then return a value

    Is "text" all the same, or should it be "text1", "text2" etc.?

    What does "a converted value" mean?

    Pete

  3. #3
    Registered User
    Join Date
    08-15-2013
    Location
    Peterborough, England
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Search for specific characters in specific positions in a cell then return a value

    Hello Pete , yes it would be "text1", "text2" etc ...

    in reply to your question " What does "a converted value" mean? " ....... sorry , just my of saying the returned text would give me a different value to that of the source 10 character code

  4. #4
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,724

    Re: Search for specific characters in specific positions in a cell then return a value

    Okay, try this, assuming your 10-character code is in A2:

    =IF(LEFT(A2,2)="AB","text1","") & IF(MID(A2,5,1)="C","text2","") & IF(MID(A2,9,1)="D","text3","")

    Hope this helps.

    Pete

  5. #5
    Registered User
    Join Date
    08-15-2013
    Location
    Peterborough, England
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Search for specific characters in specific positions in a cell then return a value

    ok great ... so i now have this ... =IF(LEFT(A1,2)="Y1","TK1 TEMPLATE ","") & IF(MID(A1,6,1)="M","","") & IF(MID(A1,10,1)="N","1","") with a final returned value of TK1 TEMPLATE 1 ...

    How would i alter the above to look for specific characters in varying positions in multiple 10 character codes ?

    Example ... In the same worksheet :

    A1 contains Y1N00M000N , the above formula looks at positions 1,2,6 & 10 to return TK1 TEMPLATE 1
    A2 contains B8T00E000M , the formula needs to look at positions 1,2,9 & 10 to return TK8 TEMPLATE 2
    A3 contains N4T0HM000R , the formula needs to look at positons 1,2 & 7 to return TK4 TEMPLATE 3

    As you can see from the above i am trying to derive varying Template numbers based on certain characters held in different 10 character codes ..

    Any help you can give would be great please ... Thanks

+ 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. Search for specific value in a row, then return content og adjacent cell
    By linaudio in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 03-20-2013, 09:11 AM
  2. [SOLVED] Formula to search a column for a specific value, and return the value in the next cell
    By TimothyD in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-26-2013, 12:02 AM
  3. [SOLVED] Help to return only first 12 characters when a cell contains specific text
    By ports83 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-25-2012, 10:30 PM
  4. [SOLVED] Search for a number in a table and return data of a specific cell
    By Karaman in forum Excel General
    Replies: 4
    Last Post: 06-30-2006, 10:50 AM
  5. search multiple sheets for specific date, return data in cell to r
    By NonIllegitimiCarborundum in forum Excel General
    Replies: 0
    Last Post: 04-28-2006, 04:10 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