Calculating how many days to next Friday
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi all,
I have the dates below:
2023-01-13
2023-01-20
2023-01-27
2023-02-03
2023-02-03
2023-02-03
2023-02-10
2023-09-15
2023-02-03
What i'm trying to figure is how to calculate how many days it is until the next Friday from these dates it should be easy enough but i cant seem to get my head around it.
Cheers for nay help in advance
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
I would use something like 5-DateTimeFormat([Date], "%w"). %w returns the day of the week as a number from 0-6, starting on Sunday. Friday would be a 5 so it would be subtracting the day from 5.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
hi @Deano478
Here's how I'd approach:
- Add 7 to the date
- Generate 1 row for every day between the two
- Add formatting to show day of week (you can collapse this into the filter tool but wanted to show you for clarity)
- Filter on Friday
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
fyi - this technically this is "the next friday" - calculating days till "next friday" - ie the next occuring friday after "this friday" would require wrapping @binuacs 's nifty 5-xxxx statement in a mod(...,5) to correctly skip this friday.
