ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Dates (https://www.excelbanter.com/excel-discussion-misc-queries/19909-dates.html)

James

Dates
 
I have two cells with a data in each cell. Is there a
formula that I could put in a third cell that determines
the number of days between the two dates?

i.e.

A1 = 4 March 2004
A2 = 28 December 2004
A3 = formula that subtracts A2 from A1 to get the number
of days between these two dates.

Many thanks!

Dahlman

Treat your dates as though they are numbers. That is what excel does. So all
you have to do is in column 3 enter =B1-C1. You may have to change the format
of the cell by right clicking on it, choosing format, and underneath "Number"
click on number.

"James" wrote:

I have two cells with a data in each cell. Is there a
formula that I could put in a third cell that determines
the number of days between the two dates?

i.e.

A1 = 4 March 2004
A2 = 28 December 2004
A3 = formula that subtracts A2 from A1 to get the number
of days between these two dates.

Many thanks!


Dave O

Your formula is:
=A2-A1

If you try it the other way around, you'll get a negative number. Just
remember to format the cell with the formula as a number (as opposed to
a date).


James

Thanks Dave and Dahlman.

James


-----Original Message-----
I have two cells with a data in each cell. Is there a
formula that I could put in a third cell that determines
the number of days between the two dates?

i.e.

A1 = 4 March 2004
A2 = 28 December 2004
A3 = formula that subtracts A2 from A1 to get the number
of days between these two dates.

Many thanks!
.



All times are GMT +1. The time now is 01:46 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com