+ Reply to Thread
Results 1 to 4 of 4

Minus 30 days but must fall on a Wednesday

Hybrid View

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

    Minus 30 days but must fall on a Wednesday

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

    Original Date
    9/1/2019
    9/16/2019
    10/1/2019


    I have to subtract 30 days from each of these dates but if the *minus 30* date does not land on a Wednesday then I need to select the nearest previous Wednesday. For example, if I subtract 30 from the three dates above I get the following:

    New date minus 30
    8/2/2019
    8/17/2019
    9/1/2019

    But what I really need are the dates you see next because they show the *previous* Wednesday.

    New date minus 30 but showing earlier Wednesday
    7/31/2019
    8/14/2019
    8/28/2019

    So, to recap, if the *minus 30* date falls on a Wednesday, I'm good. If the *minus 30* date falls on anything other than a Wednesday then I need the calculated date to show the previous calendar Wednesday. Can someone help me with this? Thank you very much.

  2. #2
    Forum Expert
    Join Date
    12-03-2009
    Location
    Florence, Italy
    MS-Off Ver
    Excel 2019
    Posts
    1,796

    Re: Minus 30 days but must fall on a Wednesday

    Ciao,

    in A1 and below your dates.

    =AGGREGATE(14,6,A1-ROW($30:$36)/(WEEKDAY(A1-ROW($30:$36))=4),1)

    to be copied down


    Regards
    -----------------------------------------------------

    At Excelforum, you can say "Thank you!" by clicking the star icon ("Add Reputation") below the post.

    Please, mark your thread [SOLVED] if you received your answer.

  3. #3
    Forum Expert Roel Jongman's Avatar
    Join Date
    03-28-2015
    Location
    Netherlands
    MS-Off Ver
    Office 365
    Posts
    1,494

    Re: Minus 30 days but must fall on a Wednesday

    Hi and welcome..

    Try with assumption that 9/1/2019 is in cell A1

    Formula: copy to clipboard
    =A4-30-WEEKDAY(A4-30,14)

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

    Re: Minus 30 days but must fall on a Wednesday

    Thanks Roel. This worked great and gave me just what I needed.

+ 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. [SOLVED] How Many Days Fall in Each Month Between Two Dates
    By skate1991 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 02-17-2017, 09:21 AM
  2. Calculate days where the range fall between dates
    By sam16 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-06-2017, 09:24 AM
  3. Replies: 6
    Last Post: 01-18-2014, 04:49 AM
  4. [SOLVED] The months that the number of days fall into
    By danfullwood in forum Excel Formulas & Functions
    Replies: 25
    Last Post: 08-28-2013, 10:07 AM
  5. Calculating the number of days which fall in financial year
    By Dermot McGrath in forum Excel General
    Replies: 2
    Last Post: 10-25-2012, 05:16 AM
  6. Allocate days into periods in which they fall
    By BRISBANEBOB in forum Excel General
    Replies: 2
    Last Post: 07-05-2009, 07:31 PM
  7. Count the number of days that fall within a particular month.
    By Portuga in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-30-2008, 04:26 PM

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