+ Reply to Thread
Results 1 to 7 of 7

Return fixed value based on the first letters

  1. #1
    Forum Contributor
    Join Date
    03-28-2019
    Location
    Costa Rica
    MS-Off Ver
    2016
    Posts
    117

    Return fixed value based on the first letters

    Hello Guys,

    I would appreciate your help.

    I have a list of multiple account numbers and I need to sort them brand meaning that if acct MB12345 should go under MyBooks, if account XB12345 goes under Xbooks brand

    The problem I have is that some accounts start with the same first two letters

    Example

    MB12345
    MBC12345

    Any formula that would help me to accomplish this?

    The report should look like this

    A B
    Account Brand
    MB1234 MyBooks
    MB78945 MyBooks
    MB13579 MyBooks
    MBC13579 MyBooksCasting
    MBC13579 MyBooksCasting
    USR3456 UnitedSelfReseler

    Thank you in advance

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: Return fixed value based on the first letters

    Hi Mente,

    See if the formulas in the yellow section work for you. The formulas in B2 and C2 can be pulled down to separate your text into letters and numbers.

    Parse 2 or 3 letters from first of string.xlsx
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Forum Contributor
    Join Date
    03-28-2019
    Location
    Costa Rica
    MS-Off Ver
    2016
    Posts
    117

    Re: Return fixed value based on the first letters

    Hello MarvinP,

    Thank you for your assistance.

    It worked but that is not what I was looking for.

    I have attached a file with how the end result should look like.

    Like I mentioned. I only have the column with the accounts (Column A) in column B I need a formula to return the name of the brand based on the first letters of the account number.

    Any help will be much appreciated.

    mente73
    Attached Files Attached Files

  4. #4
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: Return fixed value based on the first letters

    Are you looking for this? The best thing to do is build a lookup table.

    Edit: Change the formula in B2 to >> =VLOOKUP(TRIM(LEFT(A2,MIN(FIND({0,1,2,3,4,5,6,7,8,9},A2&"0123456789"))-1)),$E$2:$F$5,2,0)
    Attached Files Attached Files
    HTH
    Regards, Jeff

  5. #5
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: Return fixed value based on the first letters

    Hi Mente,

    Here is another method, different than Jeff's above:

    It is a little shorter formula at:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    I built a lookup table that you would need to do and have the 3 letter at the top of the lookup table.

    VLookup for Left 3 or 2.xlsx

  6. #6
    Forum Contributor
    Join Date
    03-28-2019
    Location
    Costa Rica
    MS-Off Ver
    2016
    Posts
    117

    Re: Return fixed value based on the first letters

    Hello Jeffrreybrown and MarvinP,

    Both options worked as expected, I really appreciate your assistance.

  7. #7
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: Return fixed value based on the first letters

    You are very welcome. Thanks for the feedback and rep.

+ 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. Replies: 2
    Last Post: 06-18-2018, 05:43 AM
  2. How to make excel return a fixed set of values
    By deckyflynn in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-02-2015, 12:45 PM
  3. How to edit fixed colummn letters or row numbers?
    By tremaine in forum Excel General
    Replies: 4
    Last Post: 05-22-2013, 09:10 AM
  4. Loan Calculator with Terms based on Fixed Payment not a fixed time frame.
    By cc4digital in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-03-2012, 04:49 AM
  5. Replies: 2
    Last Post: 11-22-2011, 12:33 PM
  6. return random letters - an example
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-31-2005, 09:05 AM
  7. [SOLVED] find and return fixed value
    By Chris in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-08-2005, 11:05 AM

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