Sunday 21 June 2015

The Excel Today function

The Excel Today function

 returns the current date. The function has no arguments and therefore, the syntax of the function is simply:
TODAY()

For further information: http://www.exceltraining-london.co.uk/excelFunctions/ExcelLondon/excelfunctiondictionary.html

Today Function Examples

The following spreadsheets show 2 simple examples of calls to the Today function, which were made on 6th January 2011. The first example shows the function used alone, and the second example shows the function used as a part of a formula that calculates the number of days that have passed since 31-Dec-2009.
The spreadsheet on the left shows the format of the formulas and the spreadsheet on the right shows the results.
 Formulas:
 AB
1 =TODAY()
231-Dec-2009=TODAY() - A2
 Results:
 AB
1 06-Jan-2011
231-Dec-2009371



Today Function Problem

The following problem is encountered by some people when using the Excel Today function:
Common Problem
When you attempt to subtract another date from the result the Today function, (as in cell B2 of the example above), the result looks like a date (eg. "16/11/1900"), instead of returning an integer.
Possible Reason
This problem arises because the new cell or column is formatted as a 'date'. In this case, it is only the formatting of the cell that is wrong, NOT the value returned by the function.
To correct this:
  • Highlight the cell(s) with the wrong formatting
  • Right click with the mouse
  • Select the Format Cells ... option and ensure the Number tab is selected
  • Under the Category heading, select the option General and click OK

No comments:

Post a Comment