In Excel, you may sometimes call a function that you expect to return a number, and find that the function result looks like a date or a time (eg. "01/01/1900", "02:00:00"), instead of an integer or decimal.
This problem usually occurs because the cell containing your formula is formatted as a date or time instead of a 'General' type or a number.
This could have occurred because either:
This formatting will cause Excel to display a simple number as a date or a time.
Note that it is only the cell formatting that is 'wrong' in this example, NOT the value returned by the function. Therefore, this problem is easily solved, by changing the cell formatting.
The quickest way to change the formatting in Excel is to select the cell(s) to be formatted and then select the required cell formatting from the drop-down menu in the 'Number' group on the Home tab of the Excel ribbon (see below):
If you have an older version of Excel, that does not have the ribbon, you can change the formatting of an Excel cell via the following steps:
For further details on Excel formatting, see the Excel formatting page.