I live in Europe. Week starts on Monday and ends on Sunday.
Today is Friday, the 5th day of the week.
https://1drv.ms/x/s!AncAhUkdErOkgqR6jJ76GcWrCJozpQ?e=mRH7Ab
=Weekday(Today();2)
shows Thursday as weekday, not friday.
Why?
And why shows Returntype 1 (or omitted) Friday, it should show Saturday (6th day of the week)?
And what is the difference between Returntype 2 and 11?
WEEKDAY is returning the correct result in that cell - i.e. 5.
If you format 5 as ddd, you are actually formatting the date 5 days after 31.12.1899 which is the 5th Jan 1900, which was a Thursday.
Related
I need to figure out how to get the dates for both the Tuesday and Thursday in the next week.
I'm currently getting the week number by using: =WEEKNUM(NOW(),)+1
I'm not sure where to go from here, please help me out.
You could use the following for Tuesday:
=NOW()+9-WEEKDAY(NOW(),2)
9 because 1 week is 7 days, then Tuesday is day 2 of the week, so 7+2=9.
For Thursday:
=NOW()+11-WEEKDAY(NOW(),2)
Same reasoning as above with Thursday being 4, so 7+4=11.
The formula basically takes the current date, adds a week (7) and then adjusts for the weekday considering today's weekday.
I am trying to calculate the weeks of the month, 1-4 or 1-5, where the calendar week that contains the first calendar day of the month is always week 1. So for example, February 1, 2018 falls on a Thursday so the dates Monday January 29 - Sunday February 4 would be week one of February.
I was using the formula =INT((DAY(D2)+6)/7) - which seemed to work until the week splits and crosses the calendar month. It counted the days the cross over from January as week 5 rather than week 1 of the next month.
Try this and see if it works:
=IF(MONTH(A2)=MONTH(A2+7-WEEKDAY(A2,2)),CEILING(((DAY(A2)+WEEKDAY(A2-DAY(A2)-1)))/7,1),1)-AND((WEEKDAY(A2-DAY(A2))=1),MONTH(A2)=MONTH(A2+7-WEEKDAY(A2,2)))
Is the following Sunday in the same month as the Date (in A2)
If False, Week = 1
If True
use last Sunday of preceding month as base for week count.
Adjust if month starts on a Monday and we are in the first week (there's possibly a better way to do this adjustment)
I have the following two functions in different columns and I need to apply a function to both :
=DATE(YEAR(E5);MONTH(E5);DAY(E5))
=TRUNC([#CAT]-TIME(10;0;0))
For both of them I need to default to a Friday if the date falls over the weekend. if date date is during the week it needs to keep the weekday date.
e.g: Sunday 2018/03/11 needs to be 2018/03/09
e.g: Monday 2018/03/5 needs to stay the same 2018/03/05
I have tried using an IF statement with a Weekday (1-7) but when its false it minus a day or two from the date (So on a Thursday it goes to Tuesday)
=WORKDAY(your_formula +1;-1)
will do what you want.
If your_formula resolves to a Sat or Sun, and we add one(1) day, then subtract one (1) workday, the preceding Fri will be the result, Since either Sun or Mon minus one workday --> Friday.
To literally get what you're after, I used this formula:
=IF(WEEKDAY(A2)=1,A2-2,IF(WEEKDAY(A2)=7,A2-1,A2))
On my machine Sunday is 1, and Saturday is 7.
The default Spotfire Work Week starts on Sunday and ends on Saturday.
I would like to adjust that default value so it starts on Monday and ends on Sunday. I would also like to adjust the work week value itself and my company's work week is one less than the default Spotfire value.
So if I'm looking at 2016, work week 1 starts Monday January 4th and ends Sunday January 10th.
Thanks!
how to add new column having week number i.e should consider sunday - saturday as 1 , next sunday - saturday as 2 in an daywise data.
Thanks in advance
Week([DateColumn]) will get you the respective week number. This resets for each year.