Explanation
The EDATE function returns a date on the same day of the month, n months in the past or future. You can use EDATE to calculate expiration dates, maturity dates, and other due dates. When 1 is given for months, EDATE returns the same date in the next month. Notice that EDATE automatically handles end-of-month dates properly, adjusting the day when needed to return a valid date.
Same date in the previous month
To get the same date in the previous month, use -1 for months:
=EDATE(date,-1) // prior month