'Google Sheet: Referencing a Pivot table custom formula to a cell with date value

I am trying to make a multiple pivot table on different sheet. Each Sheet has different date on it and I want to reference the pivot table custom formula on that cell so that every sheet has different data.

https://docs.google.com/spreadsheets/d/1aOUaRQTde4UI9LdKdACr1fsN3iEN5NIcT4z-zSBN6Gs/edit#gid=732947999



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source