A few words of thanks would be greatly appreciated.

Excel - Date/time subtraction

Ineed a macro that will subtract date-time in column A with the Present Date-time and display the value as number of days..

(Sample Calculation performed at 6/1/2012 21:00)

6/1/2012 21:44-----------------0
6/2/2012 12:42-----------------1
6/3/2012 08:44-----------------1
6/5/2012 20:44-----------------2
2/1/2012 22:32-----------------126
5/3/2012 11:11-----------------35

Values in column A can vary so calculation is done according to it..
Suppose that the data is A1 to B6

In C1 type this formula

In D1 type this formula

Highlight c1 and d1 and copy them down

Thanks to RWomanizerfor this tip.

A few words of thanks would be greatly appreciated.

Ask a question
CCM is a leading international tech website. Our content is written in collaboration with IT experts, under the direction of Jean-François Pillou, founder of CCM.net. CCM reaches more than 50 million unique visitors per month and is available in 11 languages.
This document, titled « Excel - Date/time subtraction », is available under the Creative Commons license. Any copy, reuse, or modification of the content should be sufficiently credited to CCM (ccm.net).