Some­times, we need to know what the last day of the moth is. In fact, it’s real­ly sim­ple to find it out because we have the end of month func­tion — EOMONTH. This func­tion needs a start­ing day and the num­ber of moths we are mov­ing. When we want the end of the cur­rent month, we just put 0 in the sec­ond argu­ment of the func­tion. Then, we must close the for­mu­la and that’s it (Fig. 1).

Last day of a month, EOMONTH function

=EOMONTH(A2,0)

OEMONTH function with 1
Fig. 1 OEMONTH func­tion with 0

We have the last days of cur­rent months. The EOMONTH func­tion shows the last day even if the start­ing day is the last day of the month (Fig. 2).

EOMONTH with current months
Fig. 2 EOMONTH with cur­rent months

The EOMONTH func­tion can move to the future. When we want to go one month into the future, we just put pos­i­tive num­ber (for exam­ple 1) instead of 0 (Fig.3).

=OEMONTH(A2,1)

OEMONTH with 1
Fig. 3 OEMONTH with 1

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

Last days of next months
Fig. 4 Last days of next months

If we put a big­ger num­ber (Fig.5),

=EOMONTH(A2,3)

EOMONTH with a bigger number
Fig. 5 EOMONTH with a big­ger number

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

More distant months
Fig. 6 More dis­tant months

Ana­log­i­cal­ly, if we want to move back in time, we just write a neg­a­tive num­ber. Let’s write ‑1 (Fig. 7). 

=EOMONTH(A2, ‑1)

EOMONTH with a negative number
Fig. 7 EOMONTH with a neg­a­tive number

And we are in the pre­vi­ous month (Fig. 8).

Previous months
Fig. 8 Pre­vi­ous months

If we want to move even more into the past, we just write big­ger neg­a­tive num­bers (Fig. 9).

=EOMONTH(A2,-3)

EOMONTH with a bigger negative number
Fig. 9 EOMONTH with a big­ger neg­a­tive number

As a result, the EOMONTH func­tion can move us even to pre­vi­ous or next years (Fig. 11). 

Previous or next years
Fig. 11 Pre­vi­ous or next years