+ Reply to Thread
Results 1 to 13 of 13

Convert Dates into Quarters

  1. #1
    Registered User
    Join Date
    05-02-2016
    Location
    Canada
    MS-Off Ver
    2010
    Posts
    8

    Convert Dates into Quarters

    Hi All, I am new to Excel VBA and I have a question, if someone can help,

    I am trying to convert dates into quarter. I have a row where I have dates, let’s say ROW# 3 has a date starting from January 15, 2017 and going several years (let's say Dec 10, 2019). I want to create another row above or below to convert these dates into Quarter and Merge all cells into one quarter e.g. Jan 15, 2017 to March 30, 2017 as Q1, and so on Q2, Q3, Q4.

    Thanks

  2. #2
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: Convert Dates into Quarters

    How about...

    ="Q"&ROUNDUP(MONTH(A3)/3,0)
    HTH
    Regards, Jeff

  3. #3
    Registered User
    Join Date
    05-02-2016
    Location
    Canada
    MS-Off Ver
    2010
    Posts
    8

    Re: Convert Dates into Quarters

    Hi Jeff,
    I would appreciate if you could write a code and select all those cells which have a same quarter are merged together.

    Thanks

  4. #4
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: Convert Dates into Quarters

    Attach a sample workbook. Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.

  5. #5
    Registered User
    Join Date
    05-02-2016
    Location
    Canada
    MS-Off Ver
    2010
    Posts
    8

    Re: Convert Dates into Quarters

    Here is the file,
    Attached Files Attached Files

  6. #6
    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,855

    Re: Convert Dates into Quarters

    Your sample file does not help to solve the issue. Mock up an expected result so that we can see what you are attempting. Mind reading is still very challenging for many of us.
    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

  7. #7
    Registered User
    Join Date
    05-02-2016
    Location
    Canada
    MS-Off Ver
    2010
    Posts
    8

    Re: Convert Dates into Quarters

    Hi Alan, Thanks for looking into it, Let me clarify, I will have only dates in one row. What I want to do is to convert these dates into quarter or months. that is why I sent the file with end/expected result file. I have sent the file again for better understanding. I would appreciate if you could look into this. Thanks
    Attached Files Attached Files
    Last edited by shahamat; 10-12-2017 at 06:06 PM. Reason: Attaching file

  8. #8
    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,855

    Re: Convert Dates into Quarters

    I am sorry, but I do not understand what you want. Hopefully, someone else is better at interpreting your needs. Your explanation while it may be clear to you does not express to me your needs.

  9. #9
    Registered User
    Join Date
    05-02-2016
    Location
    Canada
    MS-Off Ver
    2010
    Posts
    8

    Re: Convert Dates into Quarters

    Alan,
    I am trying to convert dates which are in 3rd row to quarters/years in row 2 and row1. Sheet2 is expected result sheet

  10. #10
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: Convert Dates into Quarters

    Sorry it took so long, but I finally was able to get this to work. Press the button on the Sheet1, but make a copy of the worksheet first so you can validate it is working as you like.
    Attached Files Attached Files

  11. #11
    Registered User
    Join Date
    05-02-2016
    Location
    Canada
    MS-Off Ver
    2010
    Posts
    8

    Re: Convert Dates into Quarters

    Thank you Jeff, it works perfectly fine.
    As you can understand this is part of a Gantt Chart/Schedule, dates will change, and currently in each Cell there is a formula to write the quarter/Year, I will try to write/find a VBA code to automatically write Quarter and Year and then run your code to merge them. Thanks again,
    Last edited by shahamat; 10-13-2017 at 11:11 PM. Reason: Solved

  12. #12
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: Convert Dates into Quarters

    Ok, let us know if you run into a snag. You're welcome.

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

  13. #13
    Registered User
    Join Date
    05-02-2016
    Location
    Canada
    MS-Off Ver
    2010
    Posts
    8

    Re: Convert Dates into Quarters

    Quote Originally Posted by shahamat View Post
    Thank you Jeff, it works perfectly fine.
    As you can understand this is part of a Gantt Chart/Schedule, dates will change, and currently in each Cell there is a formula to write the quarter/Year, I will try to write/find a VBA code to automatically write Quarter and Year and then run your code to merge them. Thanks again,
    Issue SOLVED

+ 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. How to calculate quarters between two dates
    By jenaskris in forum Excel General
    Replies: 15
    Last Post: 08-21-2014, 04:14 PM
  2. Dates / Quarters
    By pickslides in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-05-2014, 09:26 PM
  3. [SOLVED] IF formula To Convert Months To Quarters
    By Craig K. in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 05-24-2013, 09:40 AM
  4. Reading quarters from dates
    By asw301 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-10-2012, 06:50 AM
  5. Turning Dates into Quarters
    By Rob V in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 07-27-2011, 04:46 PM
  6. Number of Quarters between two dates
    By pauldaddyadams in forum Excel General
    Replies: 2
    Last Post: 04-21-2009, 10:39 AM
  7. how do I convert a dates in a year quarters in a year?
    By Linndek in forum Excel General
    Replies: 5
    Last Post: 05-11-2006, 10:35 AM
  8. Dates to quarters
    By Ainsley in forum Excel General
    Replies: 6
    Last Post: 02-27-2006, 09:39 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