+ Reply to Thread
Results 1 to 3 of 3

Round to previous quarter end

  1. #1
    Registered User
    Join Date
    10-18-2003
    Posts
    22

    Round to previous quarter end

    I have in Cell A1: =Today()
    I would like Cell B1 to equal the most recent quarter end date.

    Any ideas? Thanks

  2. #2
    Valued Forum Contributor
    Join Date
    12-16-2004
    Location
    Canada, Quebec
    Posts
    363
    Try this formula in cell b1 and then drag down

    =IF(CEILING(A1,0.25)-A1<A1-FLOOR(A1,0.25),CEILING(A1,0.25),FLOOR(A1,0.25))
    Denis

    Please always attach the sample workbook without sensitive information when asking for help

    To add a module
    Press Alt + F11 (this is the Visual Basic Environment)
    Insert Menu, select Module
    Past code there
    Close Visual Basic Environment (X)

  3. #3
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675
    So I presume that means you want to show 31st March, 30th June, 30th sept or 31st December?

    Try this formula to always show the end date of the previous quarter

    =DATE(YEAR(A1),FLOOR(MONTH(A1)-1,3)+1,0)

    Note: on a date that is actually a quarter end date, e.g. 30th June 2007 this will still show the end date of the previous quarter, 31st March. If you don't want that you could tweak it like this

    =DATE(YEAR(A1+1),FLOOR(MONTH(A1+1)-1,3)+1,0)

+ 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