Excel Formula to Identify 3rd "full" week of Month - excel

I'm creating a workplace calendar which uses formulas to identify the dates of key department events. One event I am trying to create on the calendar is the monthly department Town Hall, which is scheduled to occur on Wednesday of the 3rd "full" week of each month. I say the third full week because some months start off on a Wednesday or later which results in a partial week.
Is there a complex nested (or simple) formula I could use to identify the Wednesday of third "full" week of a new month, based of a date value in the first column of a table. Using Monday or Tuesday as the baseline to determine if the first week is a "full" week, since weekends wouldn't count for business purposes.
Sincerely,
Kristopher

Using A19 as the reference data as it has the 1st day of the month desired:
=A19+CHOOSE(WEEKDAY(a19-1),1,7,6,5,4,3,2)+15
This assumes that the first full week starts one or before a Monday.

I took ScottCramers suggestion, which worked well on the first days of the month for identifying the Wednesday of 3rd full week, then edited it a but to meet my exact needs. His formula worked perfectly on the first day of a month, in identifying the 3rd Wednesday in comparison. So I added the following to maintain the first day in relation to the row throughout the table
=DATE($A$16,MONTH([#Date]),1)+CHOOSE(WEEKDAY(DATE($A$16,MONTH([#Date]),1)-1),1,7,6,5,4,3,2)+15
This maintained the first day of month for every row. Then I added the following to compare the rows date to the formulated date, and if it was a match then that day is the TownHall event.
=IF([#Date]=DATE($A$16,MONTH([#Date]),1)+CHOOSE(WEEKDAY(DATE($A$16,MONTH([#Date]),1)-1),1,7,6,5,4,3,2)+15,"TownHall","")

Related

How do I find the date of the first day of week given any date and assuming Monday as day 1 in Excel

What I need is a formula which provides me with the date of the start of a week (Monday is day 1) for any date i chose. for example 20/10/2019 (Sunday) should yield 14/10/2019 as the start of the week. Previous similar posts don't prove to solve my problem because i have a date and not the week number (i tried this). How do I convert a calendar week into a date in Excel?
I used the date to get the week number in order to make the posted solutions work. Unfortunately excel's WEEKNUM formula automatically assumes Sunday as the first day of the week and so each Sunday's week number is counted as the following week.
WEEKNUM counts Sunday as following week
For 20/10/2019 the start of the week needs to be 14/10/2019
Try
=GivenDate-WEEKDAY(GivenDate,2)+1
replace GivenDate with a valid date or the cell reference of a valid date, such as 20/10/2019 which shall return 14/10/2019.

Calculate the number of biweekly pays in 1 month

To create a monthly budget in Google Sheets, biweekly pay needs to be calculated. Some months there are three paydays and some there are two. Paydays are every second Wednesday night.
The below formula worked previously, and now it does not.
Before being rounded, the formula calculates to =ROUNDDOWN(1.14)*1000 which multiplies the pay amount by one except there is never only one payday in a month. This month there are two pay days, 14/09/16 and 28/09/16.
=ROUNDDOWN((EOMONTH(TODAY(),0)-(MOD(DATE(2016,8,31)-DATE(YEAR(TODAY()),MONTH(TODAY()),1),14)+DATE(YEAR(TODAY()),MONTH(TODAY()),1)))/14)*1000
Where is the error in my formula?
Consider this formula:
=(INT((EOMONTH(TODAY(),0)-DATE(2016,8,31))/14)-INT((EOMONTH(TODAY(),-1)-DATE(2016,8,31))/14))*1000
It calculates all the paydays from the end of the current month back to your date of 8/31/2016 and subtracts all the paydays from the prior month back to the same date.
In march of 2017 it will give the correct 3 paydays.

Excel - Equation to produce Sunday date based on week

I am working on a time sheet. There is a cell that requires a date based on the pay period. That date will always be Sunday date of that week. I am trying to create a formula that will look at today's date and report that Sunday. For an example last week, if I filled out my time sheet last Friday the 25th it would report Sunday the 27th. Does any one know how to create this equation with out populating extra data on a sheet.
=TODAY()+(7-(WEEKDAY(TODAY())-1))

Calculating week number in Excel, when Day starts on Sunday

The following formula works great for calculating week number using the ISO standard, meaning the first week of the year is defined as beginning on the Monday of the week in which the first Thursday of January occurs. The date is located in C2.
=INT((C2-DATE(YEAR(C2-WEEKDAY(C2-1)+4),1,3)+WEEKDAY(DATE(YEAR(C2-WEEKDAY(C2-1)+4),1,3))+5)/7)
How do I change the formula to the US system, where the first week of the year is defined as beginning on the Sunday of the week in which the first Wednesday of January occurs?
Thanks.
I thought I would give a try using Excel's built in WEEKNUM formula. It doesn't work reliably for your US calculation, but for your ISO calc, it is pretty straightforward. You should be able to replace your formula above with the following
=WEEKNUM(C2,21)
For the US calculation, the following should work
=INT((C2-DATE(YEAR(C2-WEEKDAY(C2-0)+4),1,4)+WEEKDAY(DATE(YEAR(C2-WEEKDAY(C2-0)+4),1,4))+6)/7)

Excel function to determine the last Friday in a month

I'm looking for an Excel function to return the last Friday in a month for a given date.
ie: Any date in the month as input will give the date of the last Friday as output.
14-July-09 should give 31-July-09
7-March-05 should give 35-March-09
Building on #Toomas answer above, I had to make some amendments for Excel 2007, but came up with the following:
=EOMONTH(A1,0)-MOD(WEEKDAY(EOMONTH(A1,0))+1,7)
Which is assuming that the WEEKDAY returned for Friday is 6 and then applying a shifted MOD 7 to achieve the correct day.
Try this formula:
=IF(WEEKDAY(EOMONTH(A5;0);16)=7;EOMONTH(A5;0);EOMONTH(A5;0)-WEEKDAY(EOMONTH(A5;0);16))
Enter to A5 date value of which you are looking for the last Friday in a month.
The following formula achives this for a date in cell A1:
=DATE(YEAR(A1),MONTH(A1)+1,0)+MOD(-WEEKDAY(DATE(YEAR(A1),MONTH(A1)+1,0),2)-2,-7)
I came here looking for the formula to get the most recent Friday in the past which turned out to be =TODAY()-WEEKDAY(TODAY())-1
In case anyone needs to do this for next year (or future years):
=EOMONTH(DATE(YEAR(TODAY())+1,MONTH(TODAY()),1),0)-MOD(WEEKDAY(EOMONTH(DATE(YEAR(TODAY())+1,MONTH(TODAY()),1),0))+1,7)
Here's one that will show the last Friday of the current month.
And if the date is in the past it will show you next month's last Friday.
And if it's December right now, it'll show you next year's January's Friday.
=IF(DATE(YEAR(TODAY()),MONTH(TODAY())+1,0)+MOD(-WEEKDAY(DATE(YEAR(TODAY()),MONTH(TODAY())+1,0),2)-2,-7)>=TODAY(), DATE(IF(MONTH(TODAY())+1>12,YEAR(TODAY()+1),YEAR(TODAY())),MONTH(TODAY())+1,0)+MOD(-WEEKDAY(DATE(YEAR(TODAY()),MONTH(TODAY())+1,0),2)-2,-7), DATE(IF(MONTH(TODAY())=12,YEAR(TODAY())+1,YEAR(TODAY())),MONTH(IF(MONTH(TODAY())=12,1,MONTH(TODAY())))+1,0)+MOD(-WEEKDAY(DATE(IF(MONTH(TODAY())=12,YEAR(TODAY())+1,YEAR(TODAY())),MONTH(IF(MONTH(TODAY())=12,1,MONTH(TODAY())))+1,0),2)-2,-7))
You can try
=DATE(YEAR(A1),MONTH(A1)+1,1)-1+CHOOSE(WEEKDAY(DATE(YEAR(A1),MONTH(A1)+1,1)-1),-2,-3,-4,-5,-6,0,-1)
to find the last friday of the month. Assumes A1 has the date.
Hey the formatting is outdated so ill show what I came up with:
=EOMONTH(A1;A2)-(WEEKDAY(EOMONTH(A1;A2);15)-1)
[A1] is an interval of months later, from [A2] the stating date, that the result date should be.
We have some equipment that need maintenance last Friday of the month, an number of months since last Maintenace.
EOMONTH(A1;A2): we find the date, of the last day, of target month.
WEEKDAY([Date];15): assign a number for day of the week.
[15] makes Friday the value 1 and Thursday the value 7.
so if the last day of the month is Friday, the calculation would be:
[Date]-(1-1) = [Date] therefor the date won't change.
[Date] in my original code example, is the last day of the target month: [A2] date + [A1] number of months later.
if the last day is Wednesday, we want it to subtract 5 days: [Date]-(6-1) = [Date]-5
As a sidenote:
=WORKDAY(A2+1;-1;[hollydays])
will round a date back to the earlier Workday if it lands in a weekend or holyday
[holyday] can be an area of cells with predefined dates to skip eg: [$C$1:$C$20].
$ is so the area won't change when you extend the function to other cells.
if you don't care about holydays use =WORKDAY(A2+1;-1)
Awesome! Basically, like trying to find the first or second Monday of the month,
=DATE(TheYear,5,1)+CHOOSE(WEEKDAY(DATE(TheYear,5,1)),1,0,6,5,4,3,2)
which returns the first Monday of the month, in this case May
but to find the last weekday of the month, in the formula, you start with the next month and subtract
=DATE(TheYear,6,1)-1+CHOOSE(WEEKDAY(DATE(TheYear,6,1)),-6,-5,-4,-3,-2,-1,0)
which returns the last Monday of May
I have a cell that I named TheYear, in which I enter the year I'm working with, but you can point to whatever cell you have the year you want (e.g. A1).
I don't know why the pointers to the days of the week are in reverse order but to find the day (e.g. Tuesday instead of Monday), change the order of those numbers but they have to stay in order. For example, 4th Thursday of November:
=DATE(TheYear,11,1)+21+CHOOSE(WEEKDAY(DATE(TheYear,11,1)),4,3,2,1,0,6,5)
=EOMONTH(TODAY(),0)-WEEKDAY(EOMONTH(TODAY(),0))-1
This gives the last Friday of this month. You can replace both instances of Today() with any date you like or a cell reference that has a date to get the last Friday in any other month.
=WORKDAY.INTL((EOMONTH(A4,0)+1),-1,"1111011")

Resources