+ Reply to Thread
Results 1 to 9 of 9

date and time format together with quarter

  1. #1
    Registered User
    Join Date
    03-08-2010
    Location
    Sweden
    MS-Off Ver
    MS Office 365 Mac and Windows
    Posts
    94

    date and time format together with quarter

    Hello forum,

    I have output from a database and need to correct the "changed" column to correct format and also extract the year and its quarter.
    Column changed has "YYMMDDHHMM" the "0" disapears when open csv file in excel for years before 2010. I need to get full "YYYYMMDDHHMM" and also the year together with the quarter.

    Need to run this in a vba solution.
    Attached is some samples from the database. Column B and C is the output (wanted result)
    Attached Files Attached Files
    Last edited by soreno; 09-20-2018 at 07:01 AM.

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2404 Win 11 Home 64 Bit
    Posts
    23,860

    Re: date and time format together with quarter

    Here is the second part. Still working on the first part.

    Please Login or Register  to view this content.
    Last edited by alansidman; 09-20-2018 at 04:57 AM.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2404 Win 11 Home 64 Bit
    Posts
    23,860

    Re: date and time format together with quarter

    Here's the first part

    Please Login or Register  to view this content.

  4. #4
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: date and time format together with quarter

    Please Login or Register  to view this content.
    Last edited by AlphaFrog; 09-20-2018 at 05:21 AM.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  5. #5
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2016
    Posts
    5,899

    Re: date and time format together with quarter

    Or try:
    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    03-08-2010
    Location
    Sweden
    MS-Off Ver
    MS Office 365 Mac and Windows
    Posts
    94

    Re: date and time format together with quarter

    @AlphaFrog,
    Excellent!! It works pretty fast too on my test of 900 000 rows , but if I have column "changed" at "F" and I want the output on "K" and "L", how would I change the code for that to work. I have a hard time to see where the actual output goes in your code...

    Thanks

  7. #7
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: date and time format together with quarter

    You're welcome.

    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    03-08-2010
    Location
    Sweden
    MS-Off Ver
    MS Office 365 Mac and Windows
    Posts
    94

    Re: date and time format together with quarter

    @AlphaFrog,
    Lovely, it crunch thru almost a million rows in less then 10 seconds, very impressive I applause and say thank you!

  9. #9
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: date and time format together with quarter

    You're welcome. Thanks for the feedback.

+ 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] Converting Date & Time (General format) to Date (Date format)
    By supremenuts in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-22-2017, 12:55 PM
  2. Custom Format Date, Quarter.
    By Xceller in forum Excel General
    Replies: 2
    Last Post: 02-05-2014, 06:00 PM
  3. Fiscal Quarter/Year into a date format
    By bluerog in forum Excel General
    Replies: 2
    Last Post: 12-14-2009, 02:36 PM
  4. Date Format - Quarter and Fiscal Year
    By bluerog in forum Excel General
    Replies: 1
    Last Post: 11-04-2009, 12:04 PM
  5. Auto format quarter start date
    By mabeymom in forum Excel General
    Replies: 2
    Last Post: 07-14-2006, 02:42 PM
  6. Format to display date as Quarter
    By Christine in forum Excel General
    Replies: 5
    Last Post: 10-18-2005, 11:05 PM
  7. Converting a date in Excel 2002 to a Year/Quarter format
    By Jim in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-10-2005, 04:06 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