+ Reply to Thread
Results 1 to 9 of 9

Using LEFT, MID, RIGHT Functions

  1. #1
    Registered User
    Join Date
    04-05-2015
    Location
    Saihat, Saudi Arabia
    MS-Off Ver
    2013
    Posts
    46

    Using LEFT, MID, RIGHT Functions


    Hi,
    If we have organization codes in (7) or (8) digits and we want to modify these codes to read (00-000-000), we can make the required modification in two steps.
    Step (1):
    We add (0) to the (7) digits by the following formula:
    =IF(LEN(A2)=7;"0"&A2;A2)

    Name:  Org_1.jpg
Views: 340
Size:  127.8 KB

    Step (2):
    We add two(-) to the (8) digits by the following formula:
    =LEFT(B2;2)&"-"&MID(B2;3;3)&"-"&RIGHT(B2;3)

    Name:  Org_2.jpg
Views: 347
Size:  125.8 KB

  2. #2
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,602

    Re: Using LEFT, MID, RIGHT Functions

    • Right click on data in A column
    • Format cells
    • Custom
    • Type: 00-000-000

  3. #3
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,482

    Question Re: Using LEFT, MID, RIGHT Functions

    Right on
    Last edited by davesexcel; 04-07-2015 at 08:46 AM.

  4. #4
    Registered User
    Join Date
    04-05-2015
    Location
    Saihat, Saudi Arabia
    MS-Off Ver
    2013
    Posts
    46

    Re: Using LEFT, MID, RIGHT Functions

    Hi, zbor
    Thank you for your suggestion, the reason for the long example that I used in my tip is to explain to Excel users (LEFT, MID, RIGHT Functions).
    Best regards.

  5. #5
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,602

    Re: Using LEFT, MID, RIGHT Functions

    Quote Originally Posted by IMA_Saihat View Post
    Hi, zbor
    Thank you for your suggestion, the reason for the long example that I used in my tip is to explain to Excel users (LEFT, MID, RIGHT Functions).
    Best regards.
    It's OK to offer alternatives so beside learning mentioned functions everyone can also see some other approach.

    For example, your formula in Step 1 can be created without IF function as:

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    But you also don't need helper column for such thing and you can shorten it into:

    Formula: copy to clipboard
    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    04-05-2015
    Location
    Saihat, Saudi Arabia
    MS-Off Ver
    2013
    Posts
    46

    Re: Using LEFT, MID, RIGHT Functions

    Hi, zbor
    Thank you very much, I like your Formula =TEXT(RIGHT(0&A2, 8), "00-000-000"), As I mentioned before "This is the good advantage of Excel - many methods for one result".
    Regards.

  7. #7
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,602

    Re: Using LEFT, MID, RIGHT Functions

    I agree with you.
    Thanks for interesting posts.

+ 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. Using LEN and LEFT functions together
    By iamvicann in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 05-31-2009, 01:56 PM
  2. Left and Right Functions
    By jengalinato in forum Excel General
    Replies: 2
    Last Post: 03-10-2007, 10:21 AM
  3. [SOLVED] LEFT / RIGHT functions
    By Kevin G in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-06-2006, 06:10 PM
  4. right, left, functions Help
    By chintu49 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-19-2005, 10:36 AM
  5. LEFT, MID functions?
    By Lindsey M in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 03-16-2005, 05:06 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