date – Filling a calendar using Arrayformula or LOOKUP

I’ve made a calendar sheet and would like to fill it using an Arrayformula or some kind of Lookup.
The problem is, the code in each cell is different, do I need it all to be the same code or is it possible to do an Arrayformula that does a different formula for each line?

I spent ages getting the calendar code working but would now like to simplify the code and I’m not sure what my next step should be:

Any advice would be much appreciated.