Using =EOMONTH(O2,0) returns the last day of the month of O2.
=EDATE(EOMONTH(O2,0)+1,-1) returns the first day of the month of O2