+ Reply to Thread
Results 1 to 9 of 9

add constant value on a recurring date

  1. #1
    Registered User
    Join Date
    04-14-2007
    Posts
    5

    add constant value on a recurring date

    Can I have Excel automatically add a value to a cell on a certain day every month? Thanks for your help.

  2. #2
    Valued Forum Contributor
    Join Date
    07-11-2004
    Posts
    851
    something like

    =if(day(today())=XXX,your expression + 1, your expression)

    where XXX is the day on which you want to add 1
    your expressionis the formula in the cell such as = a1+b1
    not a professional, just trying to assist.....

  3. #3
    Registered User
    Join Date
    04-14-2007
    Posts
    5
    Thanks Duane. Thats a good starting point but I guess my problem may be a little more complicated by the fact that I have to add a value on the last day of the month, every month, no matter what day of the week or if its the 30th or 31st. In other words, each employee earns 8 hours sick leave for each calendar month worked. So in their cell titled "sick leave earned" I have to add "8" to whatever value is in there already, because these hours accumulate. I'm not a professional either, and I'm just starting to learn to work with dates. I can probably stumble through this with a little more help from anybody. Thanks.

  4. #4
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229
    0n what day of the month are those 8 hours added to their total?

  5. #5
    Registered User
    Join Date
    04-14-2007
    Posts
    5
    I just thought that it may be easier to add the 8 hours at 12:01 am on the first of every month (the day after it is earned) since that date would be consistent, rather than a varying date such as the 30th or 31st. Just a thought.

  6. #6
    Registered User
    Join Date
    04-14-2007
    Posts
    5
    If the formula I need were written in plain language it would read: "At 12:01 AM on the first of every month add 8 to the total in this cell."

  7. #7
    Valued Forum Contributor
    Join Date
    07-11-2004
    Posts
    851
    most equations for doing this would add the 8 every time the sheet was recalculated - it sound sto me like the hour calculationmust be based on the # of complete months elapsed since some (presumed) start date.

    something like = (month(today() - month(XXXX))*8

    where XXXX is the presumed start date
    of course since there may be multiple years involved, you need to account for that - unless you can make the equation sufficient for a ytd months

  8. #8
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229
    The problem my thinking is running into is:

    =if(today="given date",X+8,X)

    will excecute and incriment x by 8 depending on how many times it is exicuted on "given date". If one tries to get around that by
    IF NOW=specific_second then 1) the sheet needs to be active at specific_second AND a calculation causing event needs to occur during that second.
    One method would involve a cell that records "DONE FOR THIS MONTH" , and resets on the 15th or otherwise acts like a static VB variable, but that would be messy.


    A VB On_Time routine is the only thing I can think of.
    Last edited by mikerickson; 04-14-2007 at 08:51 PM.

  9. #9
    Registered User
    Join Date
    04-14-2007
    Posts
    5
    I see what you guys mean that Excel would not remember that it has already calculated this and would continue doing it every time the sheet was opened. I'm not into VB yet so I guess I'll have to add these values manually for now. Thanks for your help.

+ 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