The Klipfolio DATE_CLOSEST function lets you find the closest day of the week before or after a given date.
The syntax for the DATE_CLOSEST function is:
DATE_CLOSEST( values , dow , direction )
|values||The starting date.||scalar|
|dow||Day of the week. Options include: Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday.||scalar|
|direction||The direction. Options include forward or backward.||scalar|
Let's look at a DATE_CLOSEST function example.
The following example is based on the above text from an Excel spreadsheet:
DATEVALUE( DATE_CLOSEST( DATE( A1 , "M/d/yy" ) , Monday , backward ) , "d-MMM-yyyy" )