Sometimes, we need to know what the last day of the moth is. In fact, it’s really simple to find it out because we have the end of month function — EOMONTH. This function needs a starting day and the number of moths we are moving. When we want the end of the current month, we just put 0 in the second argument of the function. Then, we must close the formula and that’s it (Fig. 1).
=EOMONTH(A2,0)

We have the last days of current months. The EOMONTH function shows the last day even if the starting day is the last day of the month (Fig. 2).

The EOMONTH function can move to the future. When we want to go one month into the future, we just put positive number (for example 1) instead of 0 (Fig.3).
=OEMONTH(A2,1)

And we have the last days of the next month (Fig. 4).

If we put a bigger number (Fig.5),
=EOMONTH(A2,3)

we will move more into the future (Fig. 6).

Analogically, if we want to move back in time, we just write a negative number. Let’s write ‑1 (Fig. 7).
=EOMONTH(A2, ‑1)

And we are in the previous month (Fig. 8).

If we want to move even more into the past, we just write bigger negative numbers (Fig. 9).
=EOMONTH(A2,-3)

As a result, the EOMONTH function can move us even to previous or next years (Fig. 11).
