Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Reversing weekdates into 'regular' dates

Featured Replies

Hi,

One of my clients needs a function in which he can enter a weeknumber and a calc will resolve that weeknumber to a valid date, in the current year.

The outcome of that calc must be so that it is always the sunday in that week. So if he enters 11, it should display the sunday (and date) of week 11, ignoring all other days...

I've been trying all sorts of things but i can't get the calc to work properly... I didnt even start on the 'sunday' thing yet since i can't get the weeknumber reversing done frown.gif

any suggestions?

TIA

JP

Hi Balooka,

You'll need the Year anyway as the result could be different for any year given, then :

Field yearSpecified (number)

Field weekSpecified (number)

1. Step 1 :

calculate first day of year given

firstDayOf Year = Date("01/01" & yearSpecified)

2. Step 2 :

Calculate first sunday for the year (according to the week - could be a sunday in end Dec 2002 while checking for 2003... EX: 1st Sunday for 2004 will be 12/28/2003)

firstSundayofFirstWeekofYear = firstDayOf Year - MOD(DayofWeek(firstDayOf Year) +6; 7)

Step 3 :

SundayOfWeekGivenofYear = firstSundayofFirstWeekofYear + ((Weekspecified -1) * 7)

or in one calculation

c_firstSundayofWeekofYear = Date("01/01" & yearSpecified) - MOD(DayofWeek(Date("01/01" & yearSpecified)) +6; 7) + ((Weekspecified -1) * 7)

OOPS...

Just tested...

Set firstDayOf Year to Date("01", "01", yearSpecified)

  • Author

Hi Ugo

This calc is not something I would have com eup with!

Just two words... Great & Thanks!

JP smile.gif

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.