+ Reply to Thread
Results 1 to 9 of 9

convert text dates to values

  1. #1
    Registered User
    Join Date
    07-16-2017
    Location
    norway
    MS-Off Ver
    365
    Posts
    46

    Question convert text dates to values

    Hey,
    I have alot of excel export data (in red in example).
    There are names and name of the months (in Norwegian - should be close enough to English).
    I need to convert the red data into a table like the green box.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,258

    Re: convert text dates to values

    In E2

    =DATE(2016,MONTH(INDEX($B$2:$B$80,MATCH($D12,$A$2:$A$80,0))&0),1)

    in F2

    =DATE(2016,MONTH(INDEX($B$2:$B$80,MATCH($D12,$A$2:$A$80,0)+COUNTIF($A$2:$A$80,D12)-1)&0),1)

    How do we know the year or finish day: you have 01 and 31 but no explanation as to why.
    Attached Files Attached Files

  3. #3
    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: convert text dates to values

    Hi,

    Why is the end date for Carl 1/12/2016, but for Lisa it's 31/12/2016. They both have Desember as the last month.

    And why 2016? Is that the default year?
    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.

  4. #4
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Cool Re: convert text dates to values

    you can do that with PowerQuery, see attached file
    (you need to use Norwegian instead of English months - this is the pattern only, my result is not correct)
    Attached Files Attached Files
    Last edited by sandy666; 11-20-2017 at 11:30 AM.

  5. #5
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,902

    Re: convert text dates to values

    Is your Excel version English or Norwegian?

    If Norwegian you can just use helper column.
    =DATE(2016,MONTH(DATEVALUE(B2&" 1")),1)

    Which will convert month name to date value for 1st day of the month.

    If your Excel version is English... try creating Lookup table to convert month name.

    See attached.
    Attached Files Attached Files
    ?Progress isn't made by early risers. It's made by lazy men trying to find easier ways to do something.?
    ― Robert A. Heinlein

  6. #6
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,101

    Re: convert text dates to values

    Or my suggestion...
    Attached Files Attached Files
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

  7. #7
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Cool Re: convert text dates to values

    Here is localized version without changing norwegian to english & vice versa
    Norwegian (Nynorsk) is used not Norwegian (Bokmal)

    (PowerQuery)
    Attached Files Attached Files
    Last edited by sandy666; 11-20-2017 at 11:51 AM.

  8. #8
    Registered User
    Join Date
    07-16-2017
    Location
    norway
    MS-Off Ver
    365
    Posts
    46

    Re: convert text dates to values

    Thanks everybody!
    I think JohnTopleys code solves the problem.

    I did wrong with the 1st and 31st. dates... there was no way to know.

  9. #9
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: convert text dates to values

    you are welcome, thanks for the feedback
    (btw. version from post #7 is correct for you if you planning to use PowerQuery)

+ 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. Convert Text Dates to Real Dates?
    By NewYears1978 in forum Excel General
    Replies: 11
    Last Post: 04-20-2017, 07:42 PM
  2. VBA to loop different length text dates to convert to Dates
    By earlyfreak in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 06-13-2016, 06:15 PM
  3. [SOLVED] Convert Text into Dates
    By Sophie.Durrant in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-21-2014, 11:12 AM
  4. Convert Text Dates & Time to Values?
    By mycon73 in forum Excel General
    Replies: 9
    Last Post: 01-09-2013, 11:39 PM
  5. Convert Text Dates, Perform Calculation, Convert back to Text
    By Orada in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-13-2012, 05:25 PM
  6. [SOLVED] Request a Macro to Convert data into Dates (Multiple Dates Values separated by Line)
    By seenai in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-30-2012, 02:28 AM
  7. Convert Dates to text
    By lmullenjr in forum Excel General
    Replies: 3
    Last Post: 08-18-2006, 10:15 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