+ Reply to Thread
Results 1 to 3 of 3

Using month in calculation ONLY if current year is 2009.

Hybrid View

  1. #1
    Registered User
    Join Date
    12-02-2008
    Location
    Saskatchewan, Canada
    Posts
    4

    Using month in calculation ONLY if current year is 2009.

    I'm calculating sick days on an Attendance Report.
    - Sick days accumulate at a rate of 1.25 per month.
    - Employees will carry-forward unused sick days from 2008.
    - The maximum sick days is 30.

    In trying to create a formula that will multiple the current month (eg Dec=12) by 1.25, subtract any sick days taken YTD (S16), and add the carry-forward days from 2008 (W16), I noticed one problem with the following formula:

    =IF(SUM(W16+(MONTH(TODAY())*1.25)-S16)>30,30,SUM(W16+(MONTH(TODAY())*1.25)-S16))
    - the problem is if the supervisor reviews the information in Jan'10, the whole calculation changes.

    I've used an IF stmt to limit the calculations to the year 2009, and then default to 15 (1.25 * 12). Does anyone see any reason why this wouldn't work??

    =IF(SUM(W16+(IF(YEAR(TODAY())=2009,MONTH(TODAY())*1.25-S16,15)))>30,30,SUM(W16+(IF(YEAR(TODAY())=2009,MONTH(TODAY())*1.25)-S16),15))
    Any help is much appreciated. Thanks!
    Last edited by NBVC; 12-03-2008 at 06:12 PM.

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    Try:

    =IF(W16+(IF(YEAR(TODAY())=2009,MONTH(TODAY())*1.25-S16,15))>30,30,W16+(IF(YEAR(TODAY())=2009,MONTH(TODAY())*1.25-S16,15)))
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Registered User
    Join Date
    12-02-2008
    Location
    Saskatchewan, Canada
    Posts
    4
    awww... what a relief... thanks NBVC!!

+ 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