+ Reply to Thread
Results 1 to 6 of 6

quarterly, semi-annually??

  1. #1
    Registered User
    Join Date
    05-23-2006
    Posts
    2

    Question quarterly, semi-annually??

    Hi,
    new to the forum so be gentle. ok deep breath....
    I need help with a spreadsheet i have drawn up to keep track of bills.

    In one column you can select whether the bill is monthly,quarterly,semi-annual or yearly (using a dropdown list). In the next column you can select the 1st month the bill is paid (another drop down box, date in mmm format). The next column displays whether the bill is payable this month based on todays date (either yes or no). So it looks something like this:

    TODAYS DATE

    ____________M,Q,SA,Y? ___1ST BILL MONTH ___PAYABLE THIS MONTH?
    BILL1 _________SA ______________MAY ______________YES
    BILL2 _________Q________________JULY _____________NO
    BILL3 _________Y________________MARCH____________ NO

    This last column is the one im having trouble with. I can get it to say yes if the 1st bill month matches todays month, but writing a formula that works out subsequent billing months based on the m,q,sa column and then seeing if they match todays month is a real headache. they end up being massive nested affairs of the form: =IF(OR(TEXT(I5,"mmm")=TEXT(D9,"mmm"),TEXT(DATE(YEAR(D9),MONTH(D9)+3,DAY(D9)),"mmm")=TEXT(I5,"mmm")),"yes","no") where I5 is todays date and D9 is the first bill month column. This one just sees whether today matches the bill month or the bill month +3, so you could see how +3, +6, +9 would become huge.

    monthly and yearly are easy to sort out in a formula, because if a bills monthly it will always be payable and if its yearly then its only going to fall on the 1st bill month no matter what. So the problem is a formula for semi annual and quarterly months.
    Im getting myself tied up in arrays and index,match etc so i need to take a step back and let a fresh set of eyes look at the problem.

    cheers for listening to my rant

  2. #2
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675
    Assuming C9 contains "SA", "Q" or "Y", D9 a date, I5 today's date then try

    =IF(MOD(MONTH($I$5)-MONTH(D9),IF(C9="Q",3,IF(C9="Y",12,6))),"No","Yes")

  3. #3
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675
    To accommodate "M" also....

    =IF(MOD(MONTH($I$5)-MONTH(D9),IF(C9="Q",3,IF(C9="Y",12,IF(C9="M",1,6)))),"No","Yes" )

  4. #4
    Bob Phillips
    Guest

    Re: quarterly, semi-annually??

    If you change the first bill date from just a month to the actual date (you
    could format it as mmmm to look the same), then just use

    =OR(MONTH(C2)=MONTH(TODAY()),IF(B2="SA",MONTH(TODAY())=MONTH(DATE(YEAR(C2),M
    ONTH(C2)+6,1))),IF(B2="Q",MONTH(TODAY())=MONTH(DATE(YEAR(C2),MONTH(C2)+{3,6,
    9},1))))

    which is an array formula, it should be committed with Ctrl-Shift-Enter, not
    just Enter.

    --
    HTH

    Bob Phillips

    (remove xxx from email address if mailing direct)

    "colonel-shoe" <[email protected]>
    wrote in message
    news:[email protected]...
    >
    > Hi,
    > new to the forum so be gentle. ok deep breath....
    > I need help with a spreadsheet i have drawn up to keep track of bills.
    >
    >
    > In one column you can select whether the bill is
    > monthly,quarterly,semi-annual or yearly (using a dropdown list). In the
    > next column you can select the 1st month the bill is paid (another drop
    > down box, date in mmm format). The next column displays whether the
    > bill is payable this month based on todays date (either yes or no). So
    > it looks something like this:
    >
    > TODAYS DATE
    >
    > ____________M,Q,SA,Y? ___1ST BILL MONTH ___PAYABLE THIS MONTH?
    > BILL1 _________SA ______________MAY ______________YES
    > BILL2 _________Q________________JULY _____________NO
    > BILL3 _________Y________________MARCH____________ NO
    >
    > This last column is the one im having trouble with. I can get it to say
    > yes if the 1st bill month matches todays month, but writing a formula
    > that works out subsequent billing months based on the m,q,sa column and
    > then seeing if they match todays month is a real headache. they end up
    > being massive nested affairs of the form:
    >

    =IF(OR(TEXT(I5,"mmm")=TEXT(D9,"mmm"),TEXT(DATE(YEAR(D9),MONTH(D9)+3,DAY(D9))
    ,"mmm")=TEXT(I5,"mmm")),"yes","no")
    > where I5 is todays date and D9 is the first bill month column. This one
    > just sees whether today matches the bill month or the bill month +3, so
    > you could see how +3, +6, +9 would become huge.
    >
    > monthly and yearly are easy to sort out in a formula, because if a
    > bills monthly it will always be payable and if its yearly then its only
    > going to fall on the 1st bill month no matter what. So the problem is a
    > formula for semi annual and quarterly months.
    > Im getting myself tied up in arrays and index,match etc so i need to
    > take a step back and let a fresh set of eyes look at the problem.
    >
    > cheers for listening to my rant
    >
    >
    > --
    > colonel-shoe
    > ------------------------------------------------------------------------
    > colonel-shoe's Profile:

    http://www.excelforum.com/member.php...o&userid=34695
    > View this thread: http://www.excelforum.com/showthread...hreadid=544631
    >




  5. #5
    Registered User
    Join Date
    05-23-2006
    Posts
    2
    cheers for the reply guys.

    daddylonglegs, could you explain how your equation works, im not very familiar with the MOD function.

    ill mess about with both and see how i get on

  6. #6
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675
    Quote Originally Posted by colonel-shoe
    cheers for the reply guys.

    daddylonglegs, could you explain how your equation works, im not very familiar with the MOD function.

    ill mess about with both and see how i get on
    The IF function gives the second argument of the MOD function. To simplify things assume C9 is "Q" then this

    =IF(MOD(MONTH($I$5)-MONTH(D9),IF(C9="Q",3,IF(C9="Y",12,IF(C9="M",1,6)) )),"No","Yes" )

    becomes

    =IF(MOD(MONTH($I$5)-MONTH(D9),3),"No","Yes" )

    so whenever MOD(MONTH($I$5)-MONTH(D9),3) is zero you get "Yes", otherwise "No"

    Assuming MONTH($I$5) is 5 (for May) then when MONTH(D9) is 2,5,8 or 11 the MOD function is zero, thus returning "Yes" every 3 months. Look up Excel help on MOD for further information.

    Clearly "SA" and "Y" etc. work the same way although the second argument of MOD would be set to 6 and 12 respectively, giving you "Yes" every 6 or 12 months respectively

+ 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