Help

Upcoming database upgrades. Airtable functionality will be reduced for ~15 minutes at 06:00 UTC on Feb. 4 / 10:00 pm PT on Feb. 3. Learn more here

DateAdd() & Weekday() stuck on Sunday

Topic Labels: Dates & Timezones
369 4
cancel
Showing results for 
Search instead for 
Did you mean: 

Hi, I tried solving this but no avail.

If Payment Date falls on Friday(e:g 1/5), Saturday and Sunday, it should return a following Monday (1/8). If it’s Mon-Thu, keep the original date.

My Code:

IF(5-WEEKDAY({Payment Date})<=0, SWITCH( WEEKDAY({Payment Date}),
5, DATEADD({Payment Date}, 3, ‘days’),
6, DATEADD({Payment Date}, 2, ‘days’),
0, DATEADD({Payment Date}, 1, ‘days’)),
{Payment Date})

Somehow, everything is right, except Sunday. Whatever way to write the code, it keeps returning me Sunday’s date, in this case 1/7.

How can I solve this?

4 Replies 4

Try this

DATEADD(
   {Payment Date},
   SWITCH(
      WEEKDAY({Payment Date}),
      5, 3,
      6, 2,
      0, 1,
      0
   ),
   'days'
)

Hi Kamille_Parks,
I used your code and it still return as this .

test

Try turning on the “Use the same time zone (GMT) for all collaborators” option on {test}'s formatting settings.

Checked, but nothing changes. :thinking: