+ Reply to Thread
Results 1 to 10 of 10

Formula for IF/THEN EOM and/or 15th of Month based on Today's Date

  1. #1
    Registered User
    Join Date
    06-11-2013
    Location
    Chicago, IL
    MS-Off Ver
    Excel 2010
    Posts
    5

    Formula for IF/THEN EOM and/or 15th of Month based on Today's Date

    Hi I am new and apologize if I’m in the wrong forum or if I’m not making sense.

    I am trying to make a spreadsheet that will forecast how many vacation days a person will accrue on each paycheck, which happens on the 15th and last day of each month.

    Where cell A1 will be today’s date, I would like the column underneath to display the next payday, and all following for say one year. I had previously searched and found a formula that will give me the next 15th of the month but didn’t realize that this will only work if the date is earlier than the 15th.

    So if my data starts in cell A2, this is the formula I have: =DATE(YEAR(A1),MONTH(A1),IF(DAY(A1)=15,0,15))
    And then in cell A3 I have: =EOMONTH(A2,1)
    A4: =DATE(YEAR(A3),MONTH(A3),IF(DAY(A3)=15,0,15))
    A5: =EOMONTH(A1,2)

    And so on…

    So if A1 is June 20th, how do I get the next cell to display June 30th AND be able to display July 15th IF the user puts in July 5th the next time?

    Thanks.

  2. #2
    Forum Expert Ace_XL's Avatar
    Join Date
    06-04-2012
    Location
    UAE
    MS-Off Ver
    2016
    Posts
    6,074

    Re: Formula for IF/THEN EOM and/or 15th of Month based on Today's Date

    Go with

    =DATE(YEAR(A1),MONTH(A1),IF(DAY(A1)<=15,0,15))
    Life's a spreadsheet, Excel!
    Say thanks, Click *

  3. #3
    Registered User
    Join Date
    06-11-2013
    Location
    Chicago, IL
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Formula for IF/THEN EOM and/or 15th of Month based on Today's Date

    Okay, I tried that and it gives me the previous EOM. I put in July 3rd in A1 and A2 with your formula gives me June 30th.

  4. #4
    Forum Expert Ace_XL's Avatar
    Join Date
    06-04-2012
    Location
    UAE
    MS-Off Ver
    2016
    Posts
    6,074

    Re: Formula for IF/THEN EOM and/or 15th of Month based on Today's Date

    Apologies.. I got that wrong

    Try

    =IF(DAY(A1)<=15,DATE(YEAR(A1),MONTH(A1),15),EOMONTH(A1,0))

  5. #5
    Registered User
    Join Date
    06-11-2013
    Location
    Chicago, IL
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Formula for IF/THEN EOM and/or 15th of Month based on Today's Date

    THANK YOU!

    That works in cell A2, now in cell A3 I want the next date to be the following payday. I copied this formula and replaced A1 with A2 and it's giving me the same date.

    A1 is June 11th
    A2 with this formula gives me June 15th
    A3 with this formula but only changing the A1 to A2 also gives me June 15th instead of June 30th.

  6. #6
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,728

    Re: Formula for IF/THEN EOM and/or 15th of Month based on Today's Date

    Change the beginning of the formula to less than 15:

    =IF(DAY(A1)<15, ... etc

    Hope this helps.

    Pete

  7. #7
    Registered User
    Join Date
    06-11-2013
    Location
    Chicago, IL
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Formula for IF/THEN EOM and/or 15th of Month based on Today's Date

    I apologize I am still not getting the results I want.

    This is what I'm looking for. Your formula works for the first cell and the revision from Pete for the second cell, but I don't know what to change in the formula to make A3, A4, etc. to be what I want AND be able to change if today's date were after the 15th when entering this. I appreciate the help very much.

    A1 = June 11th

    A2 = June 15th
    A3 = June 30th
    A4 = July 15th
    A5 = July 31st
    A6 = August 15th
    A7 = August 31st
    etc.

  8. #8
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,728

    Re: Formula for IF/THEN EOM and/or 15th of Month based on Today's Date

    Put this formula in A1:

    =TODAY()

    or manually enter some starting date into that cell. Then put this formula in A2:

    =IF(DAY(A1)<15,DATE(YEAR(A1),MONTH(A1),15),EOMONTH(A1,0))

    then copy/paste this down as far as you need to. In copying the formula, the reference to A1 should change to A2 automatically in cell A3, then to A3 in cell A4, and so on - to copy, select cell A2, click on the <Copy> icon, then move the cursor to select the cells you want to copy into (e.g. A3:A20) then press <Enter>.

    Hope this helps.

    Pete

  9. #9
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Formula for IF/THEN EOM and/or 15th of Month based on Today's Date

    Once you have the correct date in A2 then A3 formula can be this copied down:

    =EOMONTH(A2,0)+15*(DAY(A2)>15)
    Audere est facere

  10. #10
    Registered User
    Join Date
    06-11-2013
    Location
    Chicago, IL
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Formula for IF/THEN EOM and/or 15th of Month based on Today's Date

    AH YES FINALLY! Thank you so much to everyone. Daddylonglegs you are the best, this formula in A2 finally worked. This is great!

+ 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