Save the date! Join us on October 16 for our Product Ops launch event. Register here.
Jul 21, 2022 09:36 AM
Looking to convert this excel formula into an Airtable formula.
=TODAY()+7-WEEKDAY(TODAY(),16)
Details
We run payroll every 2 weeks, so we’d like to send a reminder on the Friday that timecards are due. So, if today is 7/21, the date in the cell should read 7/29 - until it passes. Then the next date should read 8/12.
The above formula does that in Excel, but I’m at a loss of how to convert it.
Jul 21, 2022 09:46 PM
Hey Daniel, I’ve put something together here for you
The screenshot above is set up as demo data to break down the logic and to show the expected results based on the different Today
values, and the actual formula can be found in the field Actual Formula
as well as attached below
Pretty sure there’s a simpler way to do this but eh, this is what I could come up with hah
IF(
MOD(
DATETIME_DIFF(
TODAY(),
DATETIME_FORMAT(
'01/07/2022',
'DD/MM/YYYY'),
'days'
),
14
) = 0,
TODAY(),
DATEADD(
TODAY(),
(14 - MOD(
DATETIME_DIFF(
TODAY(),
DATETIME_FORMAT(
'01/07/2022',
'DD/MM/YYYY'
),
'days'
),
14
)
),
'days'
)
)
Jul 22, 2022 07:06 AM
Thanks Adam. It certainly works. Seems a bit unfortunate have to go this long way to replicate an otherwise simple Excel formula, but it does work.