+ Reply to Thread
Results 1 to 11 of 11

Show the next 1st/15th of the month with a 2-day gap

  1. #1
    Registered User
    Join Date
    05-18-2020
    Location
    usa
    MS-Off Ver
    n/a
    Posts
    3

    Show the next 1st/15th of the month with a 2-day gap

    Hi:

    Here's the output I'm looking for:

    - User types in mm/dd/yy into a box (based on client information)

    - If day = 1-12 then show 16th of that month
    ex: 6/1 shows 6/16; 6/2 shows 6/16; and so on to 6/12 shows 6/16
    nice to have: if 16th is a sat/sun then show the next Monday date

    - If day = 13-28 (or 3 days before month end in case of Feb) then show 1st of next month
    ex: 6/13 shows 7/1; 6/14 shows 7/1; etc.

    - if day = 29-31 (or last 3 days of month) then show 16th of next month
    ex: 6/29 shows 7/16; 6/30 shows 7/16; then following to July would go back to bullet one: 7/1 would show 7/16

    FOR ALL 3 SCENARIOS: If in December and date is 13th or later then year has to flip as well. If this is not possible, I can restrict to just mm/dd but would like to have year if possible.

    I've got this formula which works except for the 3rd bullet (last 3 days) and cannot figure out how to do a 3rd else statement or fix it.

    =DATE(YEAR(A1),IF(DAY(A1)<13,MONTH(A1),MONTH(A1)+1),IF(DAY(A1)<13,15,1))

    Help please?

  2. #2
    Forum Expert
    Join Date
    09-07-2014
    Location
    Israel
    MS-Off Ver
    office 365 for MAC
    Posts
    3,105

    Re: Show the next 1st/15th of the month with a 2-day gap

    Hi,
    Can you upload a sample file? It would be easier to help with a tangible demo .
    Look at the yellow banner at the top to look for more instructions.

  3. #3
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Show the next 1st/15th of the month with a 2-day gap

    If your date is in A1

    =IF(EOMONTH(A1,0)-A1<4,EOMONTH(A2,0)+16,IF(DAY(A1)<13,16+EOMONTH(A1,-1),1+EOMONTH(A1,0)))

    Or

    =TEXT(IF(EOMONTH(A2,0)-A2<4,EOMONTH(A2,0)+16,IF(DAY(A2)<13,16+EOMONTH(A2,-1),1+EOMONTH(A2,0))),"dd/mm/yyyy")
    My General Rules if you want my help. Not aimed at any person in particular:

    1. Please Make Requests not demands, none of us get paid here.

    2. Check back on your post regularly. I will not return to a post after 4 days.
    If it is not important to you then it definitely is not important to me.

  4. #4
    Registered User
    Join Date
    05-18-2020
    Location
    usa
    MS-Off Ver
    n/a
    Posts
    3

    Re: Show the next 1st/15th of the month with a 2-day gap

    Thank you!

    Only way I could break is is using 12/29:

    12/29/2020

    2/16/1900


    Shows month 2 instead of 1 and 1900

  5. #5
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,466

    Re: Show the next 1st/15th of the month with a 2-day gap

    Hoe this works:
    Please Login or Register  to view this content.
    Quang PT

  6. #6
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2016
    Posts
    5,913

    Re: Show the next 1st/15th of the month with a 2-day gap

    =IF(EOMONTH(A1,0)-A1<4,EOMONTH(A1,0)+16,IF(DAY(A1)<13,16+EOMONTH(A1,-1),1+EOMONTh(A1,0)))

  7. #7
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,466

    Re: Show the next 1st/15th of the month with a 2-day gap

    Hello Phuocam,
    Quote Originally Posted by doublebellybuster View Post
    if 16th is a sat/sun then show the next Monday date
    Quote Originally Posted by Phuocam View Post
    =IF(EOMONTH(A1,0)-A1<4,EOMONTH(A1,0)+16,IF(DAY(A1)<13,16+EOMONTH(A1,-1),1+EOMONTh(A1,0)))
    I afraid that 16-Feb (Sunday) keeps to be 16-Feb which the OP expects to be 17-Feb (Monday)

  8. #8
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Show the next 1st/15th of the month with a 2-day gap

    Here's a rough draft pending more I/O specifications.

    Please Login or Register  to view this content.
    Last edited by xladept; 05-19-2020 at 01:41 PM. Reason: smoothing
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  9. #9
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Show the next 1st/15th of the month with a 2-day gap

    Sorry

    an error crept in there

    =IF(EOMONTH(A1,0)-A1<4,EOMONTH(A1,0)+16,IF(DAY(A1)<13,16+EOMONTH(A1,-1),1+EOMONTH(A1,0)))

  10. #10
    Registered User
    Join Date
    05-18-2020
    Location
    usa
    MS-Off Ver
    n/a
    Posts
    3

    Re: Show the next 1st/15th of the month with a 2-day gap

    Thank you!!! Works!

  11. #11
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Show the next 1st/15th of the month with a 2-day gap

    You're welcome!

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

    Also, as a relatively new member of the forum, you may not be aware that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of those who helped.

    Thanks for the rep!
    Last edited by xladept; 05-20-2020 at 01:05 AM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Rounding 1st and 15th of the month
    By Lugoona in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 04-18-2020, 01:43 AM
  2. Convert all dates to first or 15th or whatever of month
    By carlito2002wgn in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 12-14-2019, 10:40 AM
  3. determine the last business day before 15th of each month
    By pmchris in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-08-2019, 11:47 PM
  4. Rounding Dates up to the 15th or the last day of the month
    By karenbr in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 12-12-2011, 04:52 PM
  5. Need to add income only between 1st and 15th of each month
    By RickyP in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-08-2008, 02:29 PM
  6. Formatting for 15th and last day of the month
    By Emilio Guerra in forum Excel General
    Replies: 1
    Last Post: 12-01-2005, 11:20 AM

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