I have the Year, Week-of-Year and Day-of-the-Week as follows:
Year = 2022 (A2) ; Week Year = 35 (B2); Week Day = 4 or Thursday (C2)
and I would like to estimate the Date as dd.mm.yyyy, which is highlighted in yellow as it shows in the EXCEL picture.
I tried many formulas, but I am sure there might be an easy one.
I think you are counting the weeks starting from zero because for 9/1/2022 (YYYY/MM/DD format) the corresponding week is 36 as per the result of function WEEKNUM(DATE(2022,9,1)). In order to use the logic to multiply the number of weeks by 7. You need to use as a reference the first day of the year, if it was a Sunday, if not then go back to the previous Sunday, so you can count the entire week. Bottom line use as a reference date, the Sunday of the first week of the year, not the first day of the year (YYYY/1/1)
Here is the approach we use in cell E2:
=LET(y, A2:A6, wk, B2:B6, wDay, C2:C6, fDay, DATE(y,1,1), seq, SEQUENCE(7),
fDay - IF(WEEKDAY(fDay)=1,0, WEEKDAY(fDay,2)) + 7*wk
+ XLOOKUP(wDay, TEXT(seq,"dddd"), seq-1))
We use the LET function to avoid repeating the same calculation. The following expression finds the previous Sunday if the first day of the year (fDay) was not a Sunday:
fDay - IF(WEEKDAY(fDay)=1,0, WEEKDAY(fDay,2))
The XLOOKUP function is used to get the numeric representation of the weekday and use the TEXT function to generate the weekdays in a long format. Since we count the entire week, if the weekday is a Sunday (column C in my screenshot), then we don't need to add any day to our reference date, that is why we use seq-1.
Here is the output for several sample data. Assuming the week count starts with zero, if not the formula needs to be adjusted as also the input data.
Notice that the year 2021 started on a Friday, so if we want to find a day for the first week (0) before Friday it will return a date from the previous year. Like in the case of Monday. If you want an error message instead, then the formula can be modified as follow:
=LET(y, A2:A6, wk, B2:B6, wDay, C2:C6, fDay, DATE(y,1,1), seq, SEQUENCE(7),
result, fDay - IF(WEEKDAY(fDay)=1,0, WEEKDAY(fDay,2)) + 7*wk
+ XLOOKUP(wDay, TEXT(seq,"dddd"), seq-1),
IF(YEAR(result) <> y, "ERROR: Date from previous year", result))
I found the solution:
Year = 2022 (A2) ; Week Year = 35 (B2); Week Day = 4 or Thursday (C2)
=DATE (A2,1,3)-WEEKDAY(DATE(A2,1,3)) + 7 * B2 + C2 - 6
I found this solution, but you need to do further testing if it really works.
I calculate month from week: =+MONTH(DATE(YEAR(A2);1;1)+B2*7-1)
I calculate week day number from week day name: =MATCH(D2;{"Monday";"Tuesday";"Wednesday";"Thursday";"Friday";"Saturday";"Sunday"};0)
And then make date using: =DATE(A2;C2;E2)
How to count days excluding weekends and holidays in excel. However, start day and end day can be weekends or holidays.
I have tried Networkdays function in excel using MAC. I also tried workdays function. And, i am new to this forum. Let me know if you are not able to understand anything.
Start Date(E) End Date (F)
2019-07-20 - 2019-08-01
2019-08-04 - 2019-08-06
2019-08-05 - 2019-08-07
2019-08-02 - 2019-08-07
2019-08-14 - 2019-08-20
Holiday list
Date(K) Description Day
8/12/19 - Eid - Monday
8/15/19 - Independence Day - Thursday
Excel formula:
= NETWORKDAYS(E2,F2,$K$7:$K$27)
Start date: Column E, End date: Column F, Holiday list: Column H
output expected output
9 8
2 1
3 1
4 2
4 2
Try using NETWORKDAYS.INTL to make sure that your weekend days are set to fall on Saturdays and Sundays.
For example:
=NETWORKDAYS.INTL(E2+1,F2-1,1,$H$2:$H$3)
Result:
I have a column in excel that has the day.
I want to add another column that will extract the week of that day (Mon-Sun) and display it as week ending on that Sunday's date.
Day
4/20/2019
4/21/2019
4/22/2019
4/23/2019
4/24/2019
4/25/2019
Expected Output
Day Week
4/20/2019 4/21/2019
4/21/2019 4/21/2019
4/22/2019 4/28/2019
4/23/2019 4/28/2019
4/24/2019 4/28/2019
4/25/2019 4/28/2019
Does anyone know how to add this column using excel functions?
WEEKDAY with the second parameter as 2 gives a number between 1 to 7 (7 being Sunday) for the day of the week. You can add to the date, the amount of days till that number becomes 7, in other words:
=A2+(7-WEEKDAY(A2,2))
I want to calculate the time difference between two dates with the following criteria:
1) excluding sundays and public holidays
2) TIMING: Mon to Fri = 7 AM to 7 PM &
Sat = 7 AM to 3 PM
I tried a many formulas and nothing works for me.
please any ideas??
Eg: Start Time: 3/6/2015 10:00 AM
End Time: 4/6/2015 12:00 PM
Then I should get the difference as 13 hrs (excluding time out of business hours)
If start and end "timestamps" will always be within working hours then you can use a formula like this:
=(SUM(NETWORKDAYS.INTL(A2,B2,{1,"1111101"},H$2:H$10)*{12,8})-IF(WEEKDAY(B2)=7,8,12))/24+MOD(B2,1)-MOD(A2,1)
Assuming start date/time in A2, end date/time in B2 and holiday list in H2:H10
Format result cell as [h]:mm and if start time is today (Monday) at 14:00 and end time is exactly a week later you will get the result 68:00 (5*12 hour days and 1*8 hour Saturday)
In my excel I have the project status in hours only .
it means
M1 4 hrs
M2 6 hrs
M3 10 hrs
M4 3 hrs
I have to create a excel so that if I give a start date all the simillar dates needs to be calculated based on 8 hrs working time.
for example if my start date 09/01/2010 (this is the date entered by me)(mm/dd/yyyy)
Start Date End Date
M1 09/01/2010 09/01/2010 (4 hrs)
M2 09/01/2010 09/02/2010 (6 hrs so talking 2 hrs from 09/02/2010)
M3 09/02/2010 09/03/2010 (6 hrs from 9/2/2010 and 4 hrs from 9/3/2010)
M4 09/03/2010 09/03/2010 (3 hrs from 9/3/2010)
Please any one can give me a suggestion.
Thanks,
Aswini Mahesh.
You have to know that dates and time in xl are stored in days since jan-1-1900 (or any fixed reference date, it does really matter which one). This allows easy addition/subtraction.
From that you can deduct that 1 day has a value of 1, and therefore 1 hour has a value of 1/24.
To test this, enter any date or time in cell, then clear cell the format.
Once you get this, you can solve any problem.
Example:
A B C
Start Date End Date Total Hours
9/15/2010 1:32 9/16/2010 1:32 24:00
9/15/2010 1:32 9/15/2010 13:32 12:00
9/15/2010 1:32 9/15/2010 7:32 06:00
9/15/2010 1:32 9/15/2010 8:44 07:12
C Cell have formula: =b2-a2+IF(a2>b2,1)
End Date - Start Date + IF(Start Date > End Date,1)
I can't attach the picture for some reason