+ Reply to Thread
Results 1 to 3 of 3

Need a Wednesday date that is the nearest to mid month

Hybrid View

  1. #1
    Registered User
    Join Date
    05-16-2019
    Location
    Tampa, Florida
    MS-Off Ver
    MS Office 365
    Posts
    46

    Need a Wednesday date that is the nearest to mid month

    Here is my dilemma. I have a column of dates such as the following:

    Original Date
    9/15/2019
    9/15/2019
    1/31/2020
    10/31/2020
    6/15/2020

    I have to add 90 days from each of these dates but the target date should be a "middle of the month" date and land on a Wednesday. For example, if I add 90 days to the three dates above I get the following:

    New date plus 90
    12/14/2019
    12/14/2019
    4/30/2020
    1/29/2021
    9/13/2020


    But what I really need are the dates you see next because they are "mid-month" and select the closest Wednesday to mid-month. The Wednesday can be on either side of the mid month date.

    12/18/2019
    12/18/2019
    4/15/2020
    1/13/2021
    9/16/2020

    So, to recap, I need the *plus 90* date to fall near an earlier mid-month date on a Wednesday. Can someone help me with this? Thank you very much. Greatly appreciated.

  2. #2
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,957

    Re: Need a Wednesday date that is the nearest to mid month

    Here is the magic formula: =DATE(YEAR(A2+90),MONTH(A2+90),15)+4-WEEKDAY(DATE(YEAR(A2+90),MONTH(A2+90),15))

    In the attached, Columns B:F were used as intermediate steps to developing this formula. You can delete them if you want. They are there to show the logic.

    First I add 90 days, that gives me a month. Then I find the 15th day of the month. Then I find out what day of the week it is. Sun = 1, Wed =4. Then I get the difference between Wednesday and the 15th. It's zero if the 15th is Wednesday, positive if before Wednesday and negative if after Wednesday. I add this number to the 15th date, and that advances or backs up the date to Wednesday.
    Attached Files Attached Files
    One spreadsheet to rule them all. One spreadsheet to find them. One spreadsheet to bring them all and at corporate, bind them.

    A picture is worth a thousand words, but a sample spreadsheet is more likely to be worked on.

  3. #3
    Registered User
    Join Date
    05-16-2019
    Location
    Tampa, Florida
    MS-Off Ver
    MS Office 365
    Posts
    46

    Re: Need a Wednesday date that is the nearest to mid month

    Yep, worked like a charm.
    Thank you so much.
    Have a great week!!

+ 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. Replies: 8
    Last Post: 08-10-2024, 09:09 AM
  2. Return the Wednesday date of a specified week of year
    By tk1434 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-07-2019, 02:15 PM
  3. [SOLVED] Need date to be 20th of month or nearest Friday if 20th is weekend
    By Ochimus in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 07-02-2016, 03:37 AM
  4. Replies: 1
    Last Post: 12-04-2012, 05:42 PM
  5. [SOLVED] Formula to figure out first wednesday in a specified month
    By darchaf in forum Excel Formulas & Functions
    Replies: 15
    Last Post: 10-28-2012, 05:00 PM
  6. Formula(s) to detect and display first Wednesday of current month
    By FrancisXSlaughterry in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-05-2011, 09:09 AM
  7. Type in Month-Year and return 3rd wednesday of month
    By learntheweek in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-09-2010, 11:29 AM

Tags for this Thread

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