+ Reply to Thread
Results 1 to 4 of 4

Working with Quarters

  1. #1
    Forum Contributor
    Join Date
    12-06-2005
    Posts
    118

    Working with Quarters

    If I have a column that shows a quarter, for example 1Q 2008, how can I add one quarter to it? So, I would like to add one quarter so it would be 2Q 2008. I get caught up with working with year end-- moving from 4Q 2007 to 1Q 2008.


    Thanks in advance!

  2. #2
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Not sure from your question what your after. If you want to drag 4Q 2007 down and have it change to 1Q 2008 this formula get you started in the right direction

    =MOD(ROW(A1)-1,4)+1&"Q "&TEXT(INT(ROW(A4)/4)+7,"2000")
    Starts at 1Q 2008

    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  3. #3
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675
    If A1 contains 1Q 2008 or similar and B1 contains the number of quarters to add (or subtract if negative) then this formula will give the relevant quarter

    =MOD(LEFT(A1)+B1-1,4)+1&"Q "&INT((LEFT(A1)+B1-1)/4)+RIGHT(A1,4)

  4. #4
    Forum Contributor
    Join Date
    12-06-2005
    Posts
    118
    Daddylonglegs, interesting formula. Have never seen that before-- thanks for sharing!

    I did write up a few if statements to accomplish the same thing but I like your formula better.

    VBA, looks similar to Daddy so thanks for sharing also!


    Thanks!

+ 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