# Lecture 5 – Number formats, dates and time in Excel Back to Excel course main page

### Number formats, date and time in Excel

Number formats allow you to preserve the original cell value while displaying it in another format such as percentage, currency, date or time format.

Calculating with dates is on of the most needed functionalities on Excel but not very well understood. Once you understand Excel’s calendar logic then it’s easy to do basic math with date and time. In the video tutorial you will also see some date and time functions such as MONTH(), MINUTE() and EOMONTH().

### Exercises

Calculate how old you are in days, months and hours. Hint: NOW() and DATE() functions might be helpful.

If you are interested you can check out the famous date bug in Excel from Wikipedia.

See the anwser
Let’s suppose you have born 25th of April 1990. Here are examples yout age in different units.

#### Days

Simply count the difference between dates and format as number. You could replace NOW() function with TODAY() which gives you the current date without a time.

`=NOW()-DATE(1990;4;25)`

#### Months

There are not very neat options to calculate or format months but this would be the simplest method.

`=(NOW()-DATE(1990;4;25))/30`

#### Hours

Count the difference between dates and format as continuous time.

`=NOW()-DATE(1990;4;25)`

### Lecture materials

Lecture 5 – Number formats, dates and time
{"ft_lang_label":"__label__en","ft_lang_prob":0.8789958,"math_prob":0.96842587,"size":1219,"snap":"2020-34-2020-40","text_gpt3_token_len":276,"char_repetition_ratio":0.1308642,"word_repetition_ratio":0.031088082,"special_character_ratio":0.23133716,"punctuation_ratio":0.10212766,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9847321,"pos_list":[0,1,2],"im_url_duplicate_count":[null,null,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2020-09-29T10:51:06Z\",\"WARC-Record-ID\":\"<urn:uuid:eb1806cc-ef30-4146-a8fd-750d3c066972>\",\"Content-Length\":\"106930\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:de2c2245-7d54-4d65-894b-7c536c56bab6>\",\"WARC-Concurrent-To\":\"<urn:uuid:f1d8eeab-3f61-44b9-8a09-9233a890ff50>\",\"WARC-IP-Address\":\"212.47.208.137\",\"WARC-Target-URI\":\"https://mikaelahonen.com/en/blog/number-formats-dates-time-excel/\",\"WARC-Payload-Digest\":\"sha1:YTG3CZX3EIC636JXLKT4XWLJDTU4K2WI\",\"WARC-Block-Digest\":\"sha1:KWV6BXGCMOAJCCOIVOK3UATSGNZYYAD7\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2020/CC-MAIN-2020-40/CC-MAIN-2020-40_segments_1600401641638.83_warc_CC-MAIN-20200929091913-20200929121913-00518.warc.gz\"}"}