Friday, November 5, 2010

Excel Date month year formula

Excel cell formula : Date month year

We Use data stored in Excel and evaluate the data in Excel
with that of our Application under test (AUT) while automation.

Sometimes it is easier to store values or formulae in excel rather than we computing in our code.

Suppose today's date is 05 november 2010
you can type the following formula in Excel

05                =TEXT(TODAY(),"dd")
11                  =TEXT(TODAY(),"mm")
Friday            =TEXT(TODAY(),"dddd")
November     =TEXT(TODAY(),"mmmm")
10              =TEXT(TODAY(),"yy")
2010      =TEXT(TODAY(),"yyyy")
06                =TEXT(TODAY()+1,"dd")  ' add one to today's date --> 05+1 = 06

So in a single cell if you would like to see today's date,month and year :
05 November,  2010
you type in as follows
=TEXT(TODAY(),"dd")&" "&TEXT(TODAY(),"mmmm")&",  "&TEXT(TODAY(),"yyyy")

&" " --> you are appending a space in between the strings returned

No comments:

Post a Comment