Get the First Friday of the Quarter Containing the Current Date

Problem description

The following Excel table contains a random datetime value in cell A1, as shown below:

undefined

We are trying to get the first Friday of the quarter which the above date falls in and enter the result date in cell B1, as shown below:

undefined

 

Directions

1.   First make sure esProc add-in is already installed in Excel. If it hasn’t, refer to Use esProc Add-in in Excel to learn about the use of esProc in Excel.

2.     Enter the following formula in B1: =esproc("=pdate@w(pdate@q(date(?,””yyyy/MM/dd””))+1)+5",A1). The statement enables using esProc syntax to do the calculation. First, pdate@q find the first date of the current quarter. Then get the next date of this date, find the Sunday that within the week containing the next date, and calculating Sunday plus 5 to get the target date.

 

 

Q & A Collection

https://stackoverflow.com/questions/63716685/get-the-first-friday-of-the-quarter-of-todays-date