Excel - Date/time subtraction

April 2018

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.
Published by aakai1056. Latest update on June 13, 2012 at 10:52 AM by aakai1056.
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 (https://ccm.net/).
A VBA code to conditionally copy data from one sheet to another
Excel - Color cells on condition