Excel - Gantt Chart - Using Workday function - Workers Holidays - excel

Good Afternoon,
I´ve developed a Gantt Grath on excel based on the workday() function to assess the end date of a task based on an inputted start date and duration. I´m now trying to improve that function by providing the annual leave days of each worker, based on a table where those days are marked with an "x" for each worker (please see the IMAGE 1 below).
I´ve worked the formula below. This formula looks for the worker name on the first column of the table, using a standard index() + match() pair and returns an array based on the days marked with an "x". That array is than used on the holidays field of the workday() function.
=WORKDAY($G$23,$H$23,IF(INDEX($B$8:$BA$18,MATCH($F$23,$B$8:$B$18,0),)="x",$C$7:$BA$7,"0"))
The problem that I´m having is that the workday() function does not count with the start date as a workday. As you can see on the second image, a task starting on the 02/10/2020 with a 3 day duration, and 2 day leave by the worker on the 05/10/2020 and 06/10/2020 should end on the 08/10/2020 and not 07/10/2020. (weekends, shown in yellow, are automatically disregarded by the formula).
I´ve already tried doing (-1) on the start date / duration added on the workday() but that just created other problems.
Can anyone help me in figuring out a solution for this problem. Thank you :)

Related

Excel - Photovoltaic - converting hours

I have a problem that I would like to solve. I got data in excel, which are
in this form, basically I have number of hours from 0 to 8760 in a column in excel, which represent the whole year. And in another column I have "Power from PV" which corresponds to how much power does photovoltaic system produce in that specific hour. I would like to convert these hours to months, so I could make a graph of monthly production of power in a whole year. Is there some sensible way to do this in excel?
Thank you for any suggestions.
You need three things:
You need to know that 1 equals 1 day, so if you want to convert hours into date related information, you need to divide it by 24.
There is a function, called Date(), which gives the date, based on year, month and day, like =DATE(2022,1,1).
There is a function, called Month(), which gives the month number of a date.
So, in summary, you need something like:
=MONTH(DATE(2022,1,1) + A3 / 24)
Once you have this in a new helper column, you can start using the Subtotals basic Excel feature.

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.

How do I get weeknum to start counting from a specific date as week 1

Im trying to automate a calendar for a maintenance schedule.
=IF(E$3>=$D5;IF(MOD(E$1-WEEKNUM($D5);INDEX($BG$5:$BG$11;MATCH($C5;$BE$5:$BE$11;0)))=0;$C5;"");"")
is the formula i have in the cells starting from E5 to the end of the year.
The numbers in row 1 are the weeknumbers of row 3, and you can see the legend for the frequency table which is housed in be5 to bg11. The problem I'm having is that sometimes the MOD returns 0 before sufficient time has passed leading to situations where the next scheduled maintenance appears to be too soon. I rationalize that if I can stipulate that the date of the last performed maintenance is weeknum 1, then I can make it work. If theres another way I'm not seeing please point it out.
https://imgur.com/a/M4d8KZW
there is a screenshot of what I have currently
Figured it out, at least for my specific issue.
=IF(E$3>=$D5;IF(AND(MOD(E$1-WEEKNUM($D5)+INDEX($BG$5:$BG$20;MATCH($C5;$BE$5:$BE$20;0));INDEX($BG$5:$BG$20;MATCH($C5;$BE$5:$BE$20;0)))=0;WEEKNUM($D5)+INDEX($BG$5:$BG$20;MATCH($C5;$BE$5:$BE$20;0))<=E$1);$C5;"");"")

Time series mock data generation for 16 years of quarterly data in Excel or Matlab

I would like to generate a mock time series quarterly dataset from, say, 2000-2016 for a variable (quarterly credit growth) that averages around a certain value (say, 30%). Can anyone give a suggestion on how to do this in principle?
Edit: what I was implying were the actual data values for each time period, i.e. data with a certain mean and variance.
Found a solution with a code in Matlab, for anyone interested, see below in answers.
Excel approach:
You can make column A your date list. In A1, or A2 or more if you have header rows, you will have to seed your list by providing the first start date. Lets assume you put your seed date in A2. I would then go about adding 3 month to you start date using a formula, and copy down until you have hit your desired date. In order to add the 3 months I would use the following in A3.
=date(year(A2),Month(A2)+3,day(A1)
that will give you the first day of the month every 3 months. If you want the first day of the month every 3 months, set the day to 1 like so:
=date(year(A2),Month(A2)+3,day(A1)
And end of month could be calculated as:
=eomonth(date(year(A2),Month(A2)+3,day(A1)),0)
however I would prefer to do the end of month calculation based on the row you are in so I would do it more like:
=EOMONTH($A$2,(rows($A$2:A3)-1)*3)

Resources