+ Reply to Thread
Results 1 to 4 of 4

How do I create a formula using part of the data in 1 cell?

  1. #1
    SMC0890
    Guest

    How do I create a formula using part of the data in 1 cell?

    I am trying to create a conditional formula that will look at the first three
    characters in a cell and determine a value based on that. Here are four
    examples of the data I am looking at and the values I need returned for each:

    Data Value returned should be
    TAD12345 Ab
    TED1263 Ed
    TAC25462 Ab CI
    TAT9456 Ab TRM

    I need a conditional formula that will look at the first three letters in
    each of these and return the value based on that. Any suggestions?



  2. #2
    Forum Contributor
    Join Date
    06-01-2006
    Posts
    324
    You would need to set up a table and then use vlookup and left function.

    Let's say your data is in column A

    set up a table in column F:G

    F as your lookup value and G as your return value:

    F G
    tad Ab
    ted Ed
    tac Ab CI
    tat Ab TRM

    and in B put this in:
    =VLOOKUP(LEFT(A1,3),F1:G4,2)

    HTH
    Google is your best friend!

  3. #3
    Dave F
    Guest

    RE: How do I create a formula using part of the data in 1 cell?

    =IF(LEFT(A1,3)="TAD","Ab","")

    Replace "" with other IF statements as appropriate.

    "SMC0890" wrote:

    > I am trying to create a conditional formula that will look at the first three
    > characters in a cell and determine a value based on that. Here are four
    > examples of the data I am looking at and the values I need returned for each:
    >
    > Data Value returned should be
    > TAD12345 Ab
    > TED1263 Ed
    > TAC25462 Ab CI
    > TAT9456 Ab TRM
    >
    > I need a conditional formula that will look at the first three letters in
    > each of these and return the value based on that. Any suggestions?
    >
    >


  4. #4
    Forum Contributor
    Join Date
    01-06-2004
    Location
    Carbondale CO
    Posts
    245
    Hi,
    I would first create a table of two columns and as many rows as you need. With your data mine looks like this.

    TAD Ab
    TED Ed
    TAC Ab CI
    TAT Ab TRM

    Then I name the table "YourTable" (you can call it what you want to) INSERT>NAME>DEFINE

    Then the following formula works for me, Assuming your data starts in cell A1 (change to suit)

    =VLOOKUP(LEFT(A1,3),YourTable,2,FALSE)

    HTH
    Casey

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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