Excel - Bi-Weekly Tasks - Fill Calendar - excel

I have a Task month calendar. when i change the month of the calendar it shows me what I have to do which day of the month.
I basically have a list of task, when i change the month the tasks date automatically change accordingly a series of rules and that list will populate the calendar.
Calendar
Tasks
But I have some tasks that are bi-weekly, and I dont have a specific week to be done, they have to be done in the fortnight after the last time.
so I have the first week (day) that the task was done and i have the first day of the month i am... and with that i would wanted to know which days of the month i have to do that specific task.
Can you help me?

use the last reference point as the basis for creating the next due date. this would be the date the task was last performed. If it is due a fortnight from that last date then add 14 days. You may want to record the date that task was performed each time so that your formula is based on the date it was last completed each time it is calculated.
If you are wanting to plan ahead then make an assumption that it will be done in consistent 14 day iterations then build your formula to consider the actual date it was completed to readjust the plan going forward. So it will assume this will be done consistently until advised otherwise with an actual date it was last completed.

The trick is to get the first date in the month that matches the weekday of the last date and then you can easily add 14 days. Much like finding the first Monday/Sunday in a month to build a calendar.
A1 contains the last time the task was performed
C1 contains the 1st of the month
C1+7-WEEKDAY(C1+7-weekday(A1))
will return the next weekday that matches the weekday the task was last performed.
=C1+7-WEEKDAY(C1+7-weekday(A1))-A1
returns the number of days since
=(C1+7-WEEKDAY(C1+7-weekday(A1))-A1)/2
returns the number of days divided by 2. If this result is not a whole number (#.5) then it's not in the bi-weekly cycle and we need to add another 7 days to get the correct start date. If it is a whole number then it is our start date. We can use the mod function to find out if there is a decimal value.
=if(mod((C1+7-WEEKDAY(C1+7-weekday(A1))-A1)/2,1)>0,C1+7-WEEKDAY(C1+7-weekday(A1))+7,C1+7-WEEKDAY(C1+7-weekday(A1)))
Below or next to this cell you can simply reference the cell and add 14 =D1+14 and then add as many as you want to display.

Related

Replace a date with another date on a file

I'm working on a way to automate a report that sometimes has different dates that fall out of a period. For example, my report has data similar to the below that has different sets of dates. Each period consists of two weeks, I'm trying to replace all of the dates that fall out of the current period to the current period (10/15/2022 & 10/22/2022).
In this scenario, I would want 10/1/2022 to be replaced with 10/15/2022 and 10/08/2022 to be replaced with 10/22/2022. In other words, assign the first week in a prior period to the first week in the current period and the same with the second week.
Is this something that can be automated?
I'm familiar with the basics of VBA but do not know where to start.

Excel formula for entering bi-weekly dates

I have the following worksheet:
The grid is filled with the following formula (this example is from cell H4) that populates the grid based on inputs from the table on the left, =IF($A4="","",IF(AND($E4="Daily",H$2>=$D4,H$2<=$G4),IF(RIGHT($F4,2)="30",LEFT($F4,LEN($F4)-2)&"/",IF(RIGHT($F4,2)="00",LEFT($F4,LEN($F4)-2),$F4)),IF(AND($E4="Weekly",H$2>=$D4,H$2<=$G4,TEXT(H$2,"DDD")=TEXT($D4,"DDD")),IF(RIGHT($F4,2)="30",LEFT($F4,LEN($F4)-2)&"/",IF(RIGHT($F4,2)="00",LEFT($F4,LEN($F4)-2),$F4)),IF(AND($E4="Bi-Weekly",H$2>=$D4,H$2<=$G4,MOD($D4+14,H$2)=0),IF(RIGHT($F4,2)="30",LEFT($F4,LEN($F4)-2)&"/",IF(RIGHT($F4,2)="00",LEFT($F4,LEN($F4)-2),$F4)),IF(AND($E4="Monthly",H$2>=$D4,H$2<=$G4,TEXT(H$2,"MM/DD/YYYY")=CONCATENATE(TEXT(H$2,"MM"),"/",TEXT($D4,"DD"),"/",TEXT($D4,"YYYY"))),IF(RIGHT($F4,2)="30",LEFT($F4,LEN($F4)-2)&"/",IF(RIGHT($F4,2)="00",LEFT($F4,LEN($F4)-2),$F4)),IF(COUNTIF('PowerPoint Gantt'!$A$5:$A$12,$A4)=1,IF(H$2=VLOOKUP($A4,'PowerPoint Gantt'!$A$5:$E$12,5,FALSE)+31,"R",""),""))))))
The only part of the function that isn't working is the Bi-Weekly selection. I can't figure out how to get recurring entries. I can get the start date and one 14 day period after. I've tried using the CEILING function also but still only gets me the next 14th day marked, instead of every 14th day. And ideas?
In your rule for Bi-Weekly meetings, it seems that
MOD($D4+14,H$2)=0
should be replaced with
MOD(H$2-$D4,14)=0
The latter takes the difference between the starting date and the actual date and checks to see if that can be divided by 14, the number of days in 2 weeks.
Your rule for Weekly meetings could be approached similarly, which seems simpler to me than a rule based on the name of the day, like you are using now.

Number of times an event occurs per year depending on start date and frequency (excel)

I'm trying to develop a formula in MS Excel that will give me the number of occurrences a task will happen in a year (or month), based on a start date, frequency and schedule in a table. I am looking to produce a table like the following (assuming the start date is 01/01/YR1):
I'm open to VBA suggestions also.
The minimum frequency is completing the task every week. Not taking into account daily tasks here. The data is held in a table. I calculated the 'times per year' using :
=IF([#Schedule]="Months",(12/[#Frequency]), IF([#Schedule]="Weeks",(52/[#Frequency]),IF([#Schedule]="Years",1/[#Frequency],0)))
I may look to take this onto a monthly schedule also, i.e. number of occurrences for each month across 5 years. It would also be useful to specify an overall end date for when the tasks would stop. (e.g. sometimes it would be year 3, sometimes year 5)
Your help is much appreciated!
=IF(D$2=1,ROUND(D$2*$C3-0.45,0),ROUND(D$2*$C3-0.45,0)-SUM($D3:OFFSET($C3,0,D$2-1)))
The formula is dragable so just place it in D3 then drag across then down. Also note the change in format of the table so the year numbers are usable in the calculations.
Note: I would suggest that the value the 5th year of the 2.5 year frequency is incorrect.
In the 3rd year you would do it and have a half year remaining. Then add that to years 4 & 5 and you get 2.5 time to do it again.

Excel function to create due dates that land on a business day

I'm stuck creating a formula that will calculate days before the end of the month then adjust to make sure it is a business day. For example: 30 days before 6/30/2015 is 5/31/2015 which is a Sunday. I need that to adjust to the Friday before.
I'm working on finding the due dates of a number of documents that are due a certain number of days before another date. For example: documents are due 30 days before the last day of the month. However, the number of days varies and the due date needs to fall on a business day (Monday-Friday). Sometimes it's 30 days, sometimes it's 60 days, sometimes it's 30 calendar days + 5 business days, etc.
I've been able to calculate 30 days + 5 business days with the following formula:
=workday(start_date-30,-5)
Any ideas how to adjust this so that I can just have the due date be 30 calendar days before a certain date but also always be a business day?
Using WORKDAY you can use a formula like this:
=WORKDAY(A1+B1+1,-1)
where A1 is your start date and B1 the number of days to add.
You probably need to write a macro function or maybe some nested IF statements in your cell's formula.
Take a look at http://www.mrexcel.com/forum/excel-questions/481558-round-date-nearest-workday.html
That solution moves forward to the nearest workday, but the principle is sound: just subtract instead of add.

Excel Subtracting periods from specific dates using 360-day calendar?

Got formulas for figuring my differences between date periods in days as follows:
=IF(F7="","0",DAYS360(F6,F7)+1)
This gives the days result for each period that I am interested in, but I then need to add each period of days together and subtract them from a current date (like doing service computation). The issue is that I need to do this second calculation within a 360-day calendar as well. If I just try to do a days360() formula with one value being the current date and the other being the total number of days that I need to backtrack, then the "original" date that it comes up with is drastically off.
This seems to be the equivalent of the difference between NETWORKDAYS and WORKDAY functions. The former counts working days between two dates, the latter adds working days to a date, you essentially want the WORKDAY equivalent for DAYS360, which I don't think exists.
You can manipulate DAYS360, though, e.g. with a date in A2 and number of days to subtract (in 360 day mode) in B2 you can use this formula for the date
=A2-B2-MATCH(B2,INDEX(DAYS360(A2-B2-ROW(INDIRECT("1:"&CEILING(B2/30,1))),A2),0),0)

Resources