+ Reply to Thread
Results 1 to 4 of 4

If statements - but need to look up value of part of the text in a particular cell

  1. #1
    Registered User
    Join Date
    07-10-2014
    Location
    US
    MS-Off Ver
    2010
    Posts
    12

    If statements - but need to look up value of part of the text in a particular cell

    Column A Column B
    ABC.1AA AA
    EFG.XBB BB
    HIJ.UCC CC
    KLM.1AA AA
    jhde.XBB BB
    tyjss.UCC CC


    I am using the formula: =IF(A2=".1AA",AA,(If (A2=".XBB","BB",If(A2=".UCC","CC",0))))
    How do I make it look at the last 3 or 4 characters and return a specific value if true ?

    I appreciate the help and support.

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: If statemens - but need to look up value of part of the text in a particular cell

    This formula will look for a match of the last four characters in the cells:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    With this particular data sample you would get the same result with
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    but maybe the data is not realistic.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: If statements - but need to look up value of part of the text in a particular cell

    Which is it, the last 3 or the last 4? Do you mean any characters after the dot.
    Is column B the result you want or another set of data which isn't in use here.

    In any case this is clearly a much simplified example and probably doesn't represent the size of your actual data. We often find that when we give an answer to what is a trivial non representative example when the solution is used with the real world data it doesn't work because of factors like string length and other stuff which is important but hasn't been mentioned.

    Therefore upload your real workbook (or at least a cut down copy), and manually add the results you expect to see. Clearly identify which is original data and which are the results and in a note clearly explain how you have arrived at your results.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  4. #4
    Registered User
    Join Date
    07-10-2014
    Location
    US
    MS-Off Ver
    2010
    Posts
    12

    Re: If statemens - but need to look up value of part of the text in a particular cell

    This is what I was looking for ! - thank you very much .
    I appreciate the help.

+ 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] How to remove part of Cell Text if partial text of that Cell is unique
    By robmbaker in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-18-2019, 09:40 AM
  2. Replies: 3
    Last Post: 07-14-2016, 03:53 PM
  3. [SOLVED] Delete a row if a cell contains certain text as part of a text string
    By Steve2107 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-15-2014, 07:49 PM
  4. Formula to identify part of a text in cell from range of cells & insert adjacent cell text
    By Novicebutnotforlong in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 11-19-2013, 02:11 AM
  5. Check if part of text is in cell, add text if true
    By schorrie in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 05-16-2013, 11:21 PM
  6. Replies: 7
    Last Post: 01-24-2013, 06:55 PM
  7. Replies: 5
    Last Post: 04-08-2012, 01:06 AM

Tags for this Thread

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