+ Reply to Thread
Results 1 to 4 of 4

extracting 1st 4 characters from a string

  1. #1
    Registered User
    Join Date
    02-18-2014
    Location
    North Carolina
    MS-Off Ver
    Excel 2010
    Posts
    2

    extracting 1st 4 characters from a string

    Should be easy. i have 8 digit invoice numbers. Each 8 digit number starts with one of three 4 digit ID codes. Depending on the first 4 digits, I want a different "company" to show up.

    First seems to work fine. Any help on wrapping this up?

    =IF(E6>"1NCC","North Carolina",IF(E6>"2ALA","Alabama",IF(E6>"3SCC","South Carolina")))

    Thanks for the help.
    Last edited by arlu1201; 02-18-2014 at 01:18 AM.

  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,933

    Re: extracting 1st 4 characters from a string

    OK dont get too upset - I changed your thread title to be more descriptive of what you want.

    =IF(left(E6,4)="1NCC","North Carolina",IF(left(E6,4)="2ALA","Alabama",IF(left(E6,4)="3SCC","South Carolina")))
    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
    Registered User
    Join Date
    02-18-2014
    Location
    North Carolina
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: extracting 1st 4 characters from a string

    not upset at all. Apparently I'm already breaking rules! I usually save that for the second date.

    Thanks for the hand and the help!

  4. #4
    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,933

    Re: extracting 1st 4 characters from a string

    That was a *wink* at your original title

    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. This made me laugh
    By Kyle123 in forum The Water Cooler
    Replies: 2
    Last Post: 01-06-2014, 07:50 PM
  2. Replies: 3
    Last Post: 07-10-2013, 06:06 PM
  3. This made me laugh
    By Kyle123 in forum The Water Cooler
    Replies: 3
    Last Post: 04-11-2013, 04:31 AM
  4. How Hard Can This Be? (That's Not What She Said :o)
    By NateBurgher in forum Excel General
    Replies: 1
    Last Post: 09-05-2010, 01:15 AM
  5. [SOLVED] So easy you will probably laugh
    By Jennifer in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-20-2005, 04:05 PM

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