Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi, i need a help, I've a variable to calculate a vDate, in order to produce a weekly report and i need this is calculated only if the first day of month is Monday, if not i need to take Monday on the previous week in order not to loose days over two different months. How can i do? Tks in advance
You can use in script:
Replace today() with your date. vDate will hold the monday, if ihe first day of month ios monday, otherwisethe monday of the previous week of your specified date.
LET vDate=
If (num(weekday(monthstart(today())=0),
makeweekdate(year(today(), week(today()),
makeweekdate(year(today(), week(today()-1))
Is that what you want?
=Date(If(MonthsStart(WeekDay(Today()),0), makeweekdate(year(today()), week(today())),
makeweekdate(year(today()), week(today()-1))),'DD/MMM/YYYY'
)
Sorry, wrong bracket
= Date(If(weekday(MonthStart(Today()))=0,
makeweekdate(year(today()), week(today())),
makeweekdate(year(today()), week(today())-1)),'DD/MMM/YYYY')
Hello Arjun,
I had a wrong bracket.This is correct (I tested it)
=Date(If(weekday(MonthStart(Today()))=0,
makeweekdate(year(today()), week(today())),
makeweekdate(year(today()), week(today())-1)),'DD/MMM/YYYY')
Regards
Rudolf