+ Reply to Thread
Results 1 to 5 of 5

Formula Error for converting date to quarter and year

  1. #1
    Registered User
    Join Date
    01-14-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    9

    Formula Error for converting date to quarter and year

    So I am using a formula to convert a date in one column to a quarter and year in another (sample spreadsheet attached). I needed to keep the cells with the formula blank if there was no date entered so the formula I am using is:
    =IF(F4="","","Q"&INT((MONTH(F4)/4)+1)&"-"&RIGHT(YEAR(F4),2))
    I thought it was working correct until I noticed some of them showing the wrong quarter. Example would be F3 to I3 and G3 to J3. If anyone could please help I would appreciate it.

    Many thanks,

    Josh

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

    Re: Formula Error for converting date to quarter and year

    Hi Josh,

    So F3, what quarter is that?

    Do you quarters run Jan to Dec?
    HTH
    Regards, Jeff

  3. #3
    Registered User
    Join Date
    01-14-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: Formula Error for converting date to quarter and year

    Q1/Jan-Mar
    Q2/Apr-Jun
    Q3/Jul-Sept
    Q4/Oct-Dec

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

    Re: Formula Error for converting date to quarter and year

    How does this work...

    =IF(N(F3),"Q"&LOOKUP(MONTH(F3),{1,4,7,10},{1,2,3,4})&"-"&YEAR(F3),"")

  5. #5
    Forum Expert Kevin UK's Avatar
    Join Date
    12-07-2010
    Location
    Radstock, Somerset
    MS-Off Ver
    365
    Posts
    1,922

    Re: Formula Error for converting date to quarter and year

    Hi jayc2111

    Another way maybe of some use.

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Regards Kevin


    Merged Cells (They are the work of the devil!!!)

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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