Hello Alex, This post is a few months old but went unanswered. Did you locate an answer to your question?
There are several examples of previous posts related to open/close dates that are likely helpful with this question. These can be found here: FAQ: Open & Close Dates
If the examples in the previous questions do not apply for you, please respnd back to the community with additional information to this thread. Supplying a sample packaged workbook with data would help a great deal.