Loading
Ozgrid Excel Help & Best Practices Forums

Excel Video Tutorials / Excel Dashboards Reports



Results 1 to 9 of 9

Thread: Formula Converts Date To Quarter & Year

  1. #1
    Join Date
    19th April 2006
    Posts
    19

    Formula Converts Date To Quarter & Year

    A1 contains a date formatted cell as dd/mm/yr, say 01/15/06. What formula, in B1, would convert this date to: Q1-06?

    Excel Video Tutorials / Excel Dashboards Reports


  2. #2
    Join Date
    7th December 2005
    Location
    Hampshire, England
    Posts
    4,898

    Re: Formula Converts Date To Quarter & Year

    How about:

    ="Q"&INT((MONTH(A1)/4)+1)&"-"&RIGHT(YEAR(A1),2)

    Excel Video Tutorials / Excel Dashboards Reports


  3. #3
    Join Date
    9th June 2006
    Location
    The best city, in the best state, in the best country, in the known inhabited universe, Houston, TX
    Posts
    966

    Re: Formula Converts Date To Quarter & Year

    rhc,

    Or, if you prefer, you can use a custom cell format like below and eliminate the need for a formula.
    "Q1-" yy
    Jim

    Excel Video Tutorials / Excel Dashboards Reports


  4. #4
    Join Date
    7th December 2005
    Location
    Hampshire, England
    Posts
    4,898

    Re: Formula Converts Date To Quarter & Year

    Jim, that gives Q1-06 even for a date in September...

    Excel Video Tutorials / Excel Dashboards Reports


  5. #5
    Join Date
    19th April 2006
    Posts
    19

    Re: Formula Converts Date To Quarter & Year

    Quote Originally Posted by ByTheCringe2
    How about:

    ="Q"&INT((MONTH(A1)/4)+1)&"-"&RIGHT(YEAR(A1),2)

    Works beautifully.

    Thanks so much!

    Excel Video Tutorials / Excel Dashboards Reports


  6. #6
    Join Date
    9th June 2006
    Location
    The best city, in the best state, in the best country, in the known inhabited universe, Houston, TX
    Posts
    966

    Re: Formula Converts Date To Quarter & Year

    Quote Originally Posted by ByTheCringe2
    Jim, that gives Q1-06 even for a date in September...
    True, you would need four formats. Works if you are talking column headers and such but not as well if you just have random dates you want to sort or something. Just thought I'd toss it out there.

    Jim

    Excel Video Tutorials / Excel Dashboards Reports


  7. #7
    Join Date
    18th November 2004
    Location
    God's Own Country
    Posts
    4,366

    Re: Formula Converts Date To Quarter & Year

    Hi,

    ="Q"&LOOKUP(MONTH(A1),{1,4,7,10},{1,2,3,4})&"-"&TEXT(A1,"yy")

    HTH

  8. #8
    Join Date
    21st February 2012
    Posts
    1

    Re: Formula Converts Date To Quarter & Year

    Slight problem with the formula.

    This one works better:

    ="Q"&INT((MONTH(A1)-1)/3+1)&" - CY"&YEAR(A1)

    You can ignore my change for the 'year' part. The part I'm fixing is the Month calculation.


    Quote Originally Posted by rhc View Post
    Works beautifully.

    Thanks so much!

    Excel Video Tutorials / Excel Dashboards Reports


  9. #9
    Join Date
    17th May 2012
    Posts
    1

    Re: Formula Converts Date To Quarter & Year

    I like using roundup() to alleviate the +1/-1 stuff:

    ="Q"&ROUNDUP(MONTH(A1)/3,0)&"-"&RIGHT(YEAR(A1),2)

    Excel Video Tutorials / Excel Dashboards Reports


Thread Information

Users Browsing this Thread

There are currently 4 users browsing this thread. (0 members and 4 guests)

Possible Answers

  1. Date converts to american format
    By littlelee in forum EXCEL HELP
    Replies: 4
    Last Post: July 27th, 2006, 00:15
  2. Replies: 3
    Last Post: April 5th, 2006, 17:20
  3. Replies: 5
    Last Post: November 16th, 2005, 21:03
  4. Replies: 3
    Last Post: December 24th, 2004, 11:33
  5. Replies: 4
    Last Post: February 11th, 2004, 07:38

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
  •  
porno