Your formula is composed correctly. The unexpected result is due to how different types of data are stored by Excel.
There are two similar systems that Excel uses for storing dates, based on a workbook level setting.
The 1900 Date System
In the 1900 date system, the first day that is supported is January 1, 1900. When you enter a date, the date is converted into a serial number that represents the number of elapsed days since January 1, 1900. For example, if you enter July 5, 1998, Excel converts the date to the serial number 35981.
By default, Microsoft Excel for Windows uses the 1900 date system. The 1900 date system enables better compatibility between Excel and other spreadsheet programs, such as Lotus 1-2-3, that are designed to run under MS-DOS or Microsoft Windows.
The 1904 Date System
In the 1904 date system, the first day that is supported is January 1, 1904. When you enter a date, the date is converted into a serial number that represents the number of elapsed days since January 1, 1904. For example, if you enter July 5, 1998, Excel converts the date to the serial number 34519.
By default, Microsoft Excel for the Macintosh uses the 1904 date system. Because of the design of early Macintosh computers, dates before January 1, 1904 were not supported. This design was intended to prevent problems related to the fact that 1900 was not a leap year. If you switch to the 1900 date system, Excel for the Macintosh does support dates as early as January 1, 1900.
These excerpts have been taken from: https://support.microsoft.com/en-us/help/214330/differences-between-the-1900-and-the-1904-date-system-in-excel
The serial number is a simple running count of the number of dates since January 1st, 1900, including the fictitious date February 29th, 1900. The DAY function, however, can additionally be thought of as a data type conversion function. It takes a date serial number as an input and returns an integer as an output. In your example, if we think of 18 as representing a date serial, and count 18 days forwards from January 1st, 1900, we end up with January 18th, 1900.
The simple fix on the front end is to change your cell format to something else like Number or General. This will tell Excel to display it to you as an integer, rather than trying to interpret it as a date serial. On the back end, everything is good to go. The integer result can be used in any other formula and will behave correctly.
As an example, lets say we wanted to create a conditional formula which told us whether or not the 15th has passed in the current month. We can do this using:
=IF(DAY(TODAY())>15,"The 15th has passed","It is not yet the 15th")
It would be much more difficult to accomplish the same result using a date serial, so the DAY function returning an integer ends up being more useful within the context of Excel's common use cases.