+ Reply to Thread
Results 1 to 9 of 9

Left, Mid and Right Functions

  1. #1
    Registered User
    Join Date
    03-25-2014
    Location
    Wilmington, DE
    MS-Off Ver
    Excel 2010
    Posts
    3

    Left, Mid and Right Functions

    I am having trouble with the left, mid and right functions. I am trying to separate the following into 3 columns:

    Aug1107...into a month column, day column, and year column

    so that one column reads "Aug", the next reads the day (11) and the next reads the year. However, when I enter the formula for left function, which for this spreadsheet reads: =left(M2,3), instead of extracting "Aug" it show the value "393". Any idea as to why or how I can fix this? Also, when I use the mid function all of the values extracted are 6 digits off. For example, instead of showing "11" it reads "05" and continues to be 6 digits off for the rest of the data. I've been all over the internet seeking help but can't seem to find the right answer. The "R1C1" box is unchecked fyi.

  2. #2
    Forum Expert judgeh59's Avatar
    Join Date
    02-07-2013
    Location
    Boise, Idaho
    MS-Off Ver
    Excel 2016
    Posts
    2,310

    Re: Left, Mid and Right Functions

    probably because it's a real XL date and that is 39305 for that date....take a look at DAY, MONTH, YEAR
    Ernest

    Please consider adding a * if I helped

    Nothing drives me crazy - I'm always close enough to walk....

  3. #3
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Left, Mid and Right Functions

    That's apparently an actual date formatted as mmmddyy.

    A
    B
    C
    1
    Aug112007
    A1: Input Format of A1: mmmddyyyy
    2
    Aug
    A2: =A$1 Format of A2: mmm
    3
    11
    A3: =A$1 Format of A3: dd
    4
    2007
    A4: =A$1 Format of A4: yyyy
    Entia non sunt multiplicanda sine necessitate

  4. #4
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    5,962

    Re: Left, Mid and Right Functions

    You are working with a formatted date value - the value for a data is - typically - a five digit number which may or may not have decimal values (the time portion of the Date/time value)

    If you want to have the month, simply use

    =M2

    and format custom as MMM

    For the day, use

    =M2

    and format custom as d

    Or just use =DAY(M2)

    For year, use
    =M2
    and format custom as yyyy

    Or just use =YEAR(M2)
    Bernie Deitrick
    Excel MVP 2000-2010

  5. #5
    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: Left, Mid and Right Functions

    It's because M2 contains a proper date. i.e. 11 August 2007. It just happens to LOOK like Aug1107 because that's the way it's formatted. Don't confuse formatting with what the cell actually contains. In this case the M2 date number is 39305 which is why you get 393 when looking at the three left characters.

    If you want to SEE the Day, month and year in three separate columns then just enter the formula =M2 in all three and format them as "mmm", "dd", and "yyyy" respectively.

    However consider why you want to do this at all. If you're wanting to analyse a data set by date/month/year etc, then you already have the data in column M and you probably don't need any further splits.
    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.

  6. #6
    Registered User
    Join Date
    03-25-2014
    Location
    Wilmington, DE
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Left, Mid and Right Functions

    Thanks everyone for the help!

  7. #7
    Registered User
    Join Date
    03-25-2014
    Location
    Wilmington, DE
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Left, Mid and Right Functions

    One more problem I just came across. In the day column it did show the correct 2 digit day for that row, however, in the formula bar at top it shows the full data as "01/11/1900" when the date in the column I am referencing is "08/11/2007". Am I missing something simple?

  8. #8
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Left, Mid and Right Functions

    J, there were several different suggestions. Which did you use?

  9. #9
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    5,962

    Re: Left, Mid and Right Functions

    Yes - just format at General instead of as a Date.

    Dates are just numbers - the number of days since 12/31/1899. That is why 11 shows as 01/11/1900 if it is formatted as a date.

+ 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. RIGHT/LEFT/MID Functions
    By blind527 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 04-18-2013, 05:02 PM
  2. Excel 2007 : right, mid, and left functions
    By ghhoyl in forum Excel General
    Replies: 7
    Last Post: 09-01-2010, 08:13 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