Excel Formula for finding if the 16th lands on a Saturday or Sunday and if it does, returning the date of the following Monday - excel

Imagine that in cell A1 you have the first day of the month. I need a formula that finds if the 16th day of that month falls on a weekend (Saturday or Sunday) and if that is the case, return the date of the following Monday. If the 16th is not on a weekend, it will just return the date of the 16th
=If( (A1 + 15) = Saturday or Sunday, Date of the next Monday, (A1 + 15) )
I apologize in advance for my formula being terrible, I'm at a loss on this one.
For example, if A1 = "10/1/2019" then the forula will return 10/16/2019 because the 16th is not a weekend. However, is A1 = "11/1/2019" then the formula will return 11/18/2019 because the 16th is a Saturday. Thanks!

You can use the WEEKDAY function to determine the day of the week.
=IF(WEEKDAY(A1+15,2)=6,A1+17,IF(WEEKDAY(A1+15,2)=7,A1+16,A1+15))

The workday function is probably the easiest way to do this:
=WORKDAY(A1+14,1)
A1+14 --> the fifteenth of the month
We then add one workday. If that added workday falls on a Sat or Sun (or optional holiday if you want to do that), the weekend days will be skipped, otherwise the 16th will be returned.

Related

Formula based on first monday or tuesday etc of the week

Is there a way to put a year into a cell (say A1), then the day of the week you want (say Monday in cell A2) and enter into the 12 cells below it the first monday of each month (or first tuesday, etc, based on whats in cell A2)?
I have been able to figure out how to do it with 1 day but I would like it to be interactive.
=DATE(2022,{1;2;3;4;5;6;7;8;9;10;11;12},7-WEEKDAY(DATE(2022,{1;2;3;4;5;6;7;8;9;10;11;12},1)-5,3))
With Office 365:
=LET(yr,A1,
wkdy,MATCH(PROPER(A2),{"Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"},0),
mnt,SEQUENCE(12),
DATE(yr,mnt,1)+MOD(8-WEEKDAY(DATE(yr,mnt,1),10+wkdy),7))
You where pretty close with your formula
=DATE(A1,{1;2;3;4;5;6;7;8;9;10;11;12},7)-WEEKDAY(DATE(A1,{1;2;3;4;5;6;7;8;9;10;11;12},7),A2)
Where
A1 = year string
A2 = day of the week as number (1 = Saturday, 2 = Sunday, etc.)

Formula to select a date 3 business days later than the cell on its left

In my Excel workbook, I have "November 10th". I want every cell in the column to the right to display a date 3 days later, but it has to be a weekday Monday - Friday, it can't fall on a Saturday or Sunday. So if "November 10th" is a Thursday the date on the cell next to it should state "November 14th".
Having the date in A1, use =WORKDAY(A1,3).
You can also put the third argument to exclude holidays in this function.

Find first date after today that matches a day-number and weekday

Given any date, how do I find the first month and year in the future where the 31st of that month falls on a Wednesday, in other words, for today, 11 November 2020, I would like to see (31) March 2021. [Updated: Returned month should be March 2021]
#prino,
You could make use of Excel's Iterative Calculation, setting Maximum Iterations to 1000.
In the example below, A1 is the given date and B1 receives the result (put the formula in B1):
=IF(B1=0,A1)+B1+IF(AND(WEEKDAY(B1,1)=4,DAY(B1)=31),0,1)
If you have Excel 365 then
=LET(DayInMonth, DATE(YEAR($A$2),MONTH($A$2)+SEQUENCE(336,,0,1),$B$2),
DOW, WEEKDAY(DayInMonth),
IsMatch, (DAY(DayInMonth)=$B$2)*(DOW=$C$2)*(DayInMonth>=$A$2),
XLOOKUP(1,IsMatch,DayInMonth,,0,1))
How it works:
Parameters are on the sheet (you could hard code these into the formula if you wish)
A2 is the start date (could be formula =TODAY())
B2 is the day number in the month
C2 is the day of week code (1..7 = Sunday..Saturday)
The calander repeats every 28 years. So only need to consider 12*28 = 336 months
DayInMonth is the specified date in each of the next 336 months, including this month. Note: if a month does not have the specified day (eg 31 September does'nt exist)
DOW is the day of Week code for those dates
IsMatch is 1 if calculated DayInMonth matches specified DayInMonth (this excluded non-existant dates) AND Calculated DOW matches specified DOW AND calculated date is on or after start date
XLOOKUP returns the date of the first 1 in the IsMatch array

How to identify the week within a month with criteria in Excel

How can I calculate the week of the month? I understand that with the WEEKNUM function and ISOWEEKNUM function I can get the week of the year but this is not what I am looking for.
A week has only 4 weeks so the function must look at a date written in a cell and only identify a week 1-4
There is one set of criteria that I found especially difficult to add:
Week 1 for July 2019 begins on June 30th - Ends on July 27th
Week 1 for August begins on July 28th - Ends on August 24th
How can something like this added to an excel function?
This formula calculates a week in month (assuming your have a date at A1 cell)
=WEEKNUM(A1,2)–WEEKNUM(DATE(YEAR(A1),MONTH(A1),1),2)+1
Use WEEKNUM to get the week of year.
Use WEEKNUM to from the date of the first day of the month the date falls within.
Subtract the two week numbers (add 1 in case result is 0 - first week in month).
Sample:
8/21/2019
=WEEKNUM(A1,2) -> 34
WEEKNUM(DATE(YEAR(A1),MONTH(A1),1),2) -> 31
34-31 = 3 -> third week of August

Convert Week NUM to the Week Beg date in Excel

I have the below formula to give me the week ending of a week num, how can I get the date of the week beginning from this?
=DATE(YEAR(TODAY()),1,1)+(7-WEEKDAY(DATE(YEAR(TODAY()),1,1))-6)+(A2*7)
when A2 is 10 for example and B2 is the date.
thanks
Are your weeks ISO weeks? If so then that formula might work for this year but it will be wrong in 2016 because it will give the end date of week 1 as 3rd Jan when it should be 10th Jan
I would use this formula for start date (a Monday)
=DATE(YEAR(TODAY()),1,A2*7-2)-WEEKDAY(DATE(YEAR(TODAY()),1,3))
then just add 6 for the end date
=DATE(YEAR(TODAY()),1,A2*7+4)-WEEKDAY(DATE(YEAR(TODAY()),1,3))

Resources