+ Reply to Thread
Results 1 to 2 of 2

Mid function failing

  1. #1
    Registered User
    Join Date
    04-21-2019
    Location
    Toronto, Canada
    MS-Off Ver
    365
    Posts
    1

    Mid function failing

    I am looking to extract the month from a date using the mid function. i have 450000 rows of data and want to add a column with month as a data point for easier pivot manipulation. however - getting the following:

    example - (source cell: C2) 2018-06-10 17:16, (destination cell formula) =MID(C2,6,2), (destination cell results) .7

    Cant figure it out - please help.

  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: Mid function failing

    If you really are using REAL dates (and not text looking like dates - you can test with =isnumber(cell-ref)...FALSE indicates text date), then...

    What you need to understand about dates and times in excel is…

    a date is just a number representing the number of days passed since 1/1/900...and then formatted in a way that we recognize as a date. So, for instance, today (Sun 21 Apr 2019) is actually 43576

    Time is actually a decimal part of 1 (day), so 06:00 AM is 0.25, 12 noon is 0.5 and 18:00 (or 6 PM) is 0.75

    So =MID(TODAY(),3,2) = 57

    To get just the month number...
    =MONTH(TODAY())
    = 4
    To get the month name
    =TEXT(today(),"mmm")
    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

+ 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. [SOLVED] TEXT Function Failing in Excel 2016 365 - ONLY READ IF YOU WANT A LAUGH!!!
    By AliGW in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-10-2017, 08:37 AM
  2. [SOLVED] .find Function Failing
    By Centexcel in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 06-26-2013, 11:36 AM
  3. Function To Create PivotTable failing.
    By Authentik8 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-08-2012, 08:35 AM
  4. Excel 2007 : Hyperlink function failing
    By INEEDHELP321 in forum Excel General
    Replies: 5
    Last Post: 04-20-2012, 05:18 PM
  5. Excel 2007 : IF Function failing on product code
    By smudgepost in forum Excel General
    Replies: 7
    Last Post: 06-10-2010, 10:26 AM
  6. Search or lookup function... attempting and failing
    By jhubbzwhat in forum Excel General
    Replies: 4
    Last Post: 10-15-2008, 11:03 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