Change Date Settings in Spotfire - spotfire

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!

Related

Weekday(...) shows wrong weekday

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.

Find the trading date every 2 weeks (if Saturday or Sunday, then show Friday date)

For a backtesting trading system, I need to rotation my positions every 2 weeks, BUT if the day is a Saturday or Sunday, I need to take the Friday.
Semi-Monthly updates are made twice a month; mid-month and month end.
Mid-month updates are on the 15th calendar day of each month. Should the 15th be a weekend or holiday, the update will occur on the last trading day prior to the 15th.
For example, if the 15th is a Saturday then the update will occur on the close of Friday the 14th.
I need to return a list of dates of rotation based on a start date and end date.
Let's say, I need every 15 days from January 1st 2018 to 31st December 2018, it should return only the valid dates based on the rules described above.
The formula should be for Google Sheet or Excel.
I tried the following:
It is not returning exactly what I need, since the google sheet googlefinance formula allows to use daily and weekly intervals (1 or 7). See below the googlefinance definition (https://support.google.com/docs/answer/3093281?hl=en):
"interval - [ OPTIONAL ] - The frequency of returned data; either "DAILY" or "WEEKLY".
interval can alternatively be specified as 1 or 7. Other numeric values are disallowed."
You need to be more precise in your specifications. You've provided multiple inconsistent intervals. eg: Two weeks (which would be every 14 days and will always fall on the same weekday); every 15 days (which will NOT be mid-month and EOM over most time periods); mid-month and end-of-month.
I suggest developing formulas for each of your desired intervals.
Once you have developed those relevant formulas, depending on your desired interval, to avoid a date falling on a weekend (or holiday if required for your system), you can use the WORKDAY function:
=WORKDAY(computedDate+1,-1, [holiday])
If your computedDate is on a Saturday, or Sunday; by adding 1 day and then subtracting to the previous workday, Friday will result.
If your trading interval is every Two weeks, you only need to ensure that the First date is not on a Saturday or Sunday. For other intervals, you may have to apply the formula to every computedDate.

excel if date falls on weekend default to previous friday

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.

Excel weeknum function returns wrong week

Question is as in title.
I have a cell, "D4", with the date "09/07/2016" in it. Adjacent cell has formula "=weeknum(D4,1)". The output of this function is "28". But on a Sunday-Saturday basis, Saturday the 9th of July wasn't in week 28 - it was in week 27.
I thought this might be something to do with Saturday/Sunday and when the week starts and finishes, etc, so I tried multiple different dates from last week - Monday the 4th, Tuesday the 5th, Wednesday the 6th, etc. In each case, "weeknum" returns a value of "28".
I only noticed the problem because I have a macro which uses the value of the cell with the week number to look for a spreadsheet saved by our accounts team on a weekly basis. As they have - correctly - saved the spreadsheet as "week 27", it didn't work. I initially assumed that the accounts team were wrong, but I checked online and they are correct.
How could this happen? Surely Excel can't be wrong and I must have made a mistake of some sort?
I know that there is an issue with Excel not following ISO standards for when weeks 53 and 1 begin and end, but I don't see how that could affect a mid-year week.
It did occur to me that the issue might be to do with UK versus US date formatting. But, of course, the 7th of June wasn't in week 28 either.
That all is documented in WEEKNUM.
There are two systems used for this function:
System 1 The week containing January 1 is the first week of the
year, and is numbered week 1.
System 2 The week containing the first Thursday of the year is the
first week of the year, and is numbered as week 1. This system is the
methodology specified in ISO 8601, which is commonly known as the
European week numbering system.
Syntax
WEEKNUM(serial_number,[return_type])
Return_type Week begins on System
...
21 Monday 2
So =WEEKNUM("09/07/2016",21) will calculate as defined in ISO 8601 since Return_type 21 is the only one with System 2.
ISOWEEKNUM
=ISOWEEKNUM("09/07/2016")
will also do it.
=ISOWEEKNUM(a2)-1 returns the correct week for me, the same as =WEEKNUM(a2,21)-1

YEAR() fitting to WEEKNUM(...,21) in Excel

I'm looking for a way to specify return 2015 for a date within this week, but in Calendar Year 2014.
This current week according to the Thursday system is Week 01/2015. But the Year function will still return 2014.
Something like:
IF(AND(WEEKNUM(TODAY(),21)=52,WEEKNUM(TODAY()+7,21)<>53),YEAR(TODAY())+1,YEAR(TODAY())
but a little bit more reliable and elegant.
Anybody got something?
Happy Happy
Ben-san
The "Year" of the week is determined by the year of the Thursday of that week (assuming ISO week numbers) so you can just find the Thursday and then get the year of that date, i.e. for any date in A1
=YEAR(A1-WEEKDAY(A1,3)+3)
or, similarly, for today's date
=YEAR(TODAY()-WEEKDAY(TODAY(),3)+3)
This works for any date in any year.......and might put days in Jan in the previous year also, e.g. 3rd Jan 2016 is in the last week of 2015

Resources