Excel Finding number of days between 2 dates :: MrExcel Message Board


 FAQFAQ
   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   FavoritesFavorites   StatisticsStatistics 
 RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
Online StoreOnline Store

MrExcel Message Board Forum Index -> Excel Questions

Finding number of days between 2 dates
Post new topic   Reply to topic
Last Thread | Next Thread  >   Printable version
  Author    Thread

dbrb2
Board Regular


Joined: 12 Aug 2002
Posts: 28


Status: Offline

 Reply with quote  

I have a column of dates, and want to have a further column which shows the days between the date in each cell of the column and the current date (i.e the date stored in the system clock). Can anyone suggest any ways of doing this?

Ben

Post Wed Aug 14, 2002 10:56 am 
 View user's profile Send private message Send e-mail

Mark W.
MrExcel MVP


Joined: 11 Feb 2002
Posts: 7146
Location: Austin, Texas USA
Flag: Usa

Status: Offline

 Reply with quote  

=TODAY()-A2

Post Wed Aug 14, 2002 11:07 am 
 View user's profile Send private message

dbrb2
Board Regular


Joined: 12 Aug 2002
Posts: 28


Status: Offline

 Reply with quote  

I had already tried that I'm afraid, it appears to subtract one date from another, and the output is a date. I was hoping to find a way of outputing a number - so that for instace 17/8/02 would give 3 (taking the date format as dd/mm/yyyy, and todays date as the 14th , 17-14=3.

Post Wed Aug 14, 2002 11:22 am 
 View user's profile Send private message Send e-mail

dbrb2
Board Regular


Joined: 12 Aug 2002
Posts: 28


Status: Offline

 Reply with quote  

I had already tried that I'm afraid, it appears to subtract one date from another, and the output is a date. I was hoping to find a way of outputing a number - so that for instace 17/8/02 would give 3 (taking the date format as dd/mm/yyyy, and todays date as the 14th , 17-14=3.

Post Wed Aug 14, 2002 11:26 am 
 View user's profile Send private message Send e-mail

dbrb2
Board Regular


Joined: 12 Aug 2002
Posts: 28


Status: Offline

 Reply with quote  

I had already tried that I'm afraid, it appears to subtract one date from another, and the output is a date. I was hoping to find a way of outputing a number - so that for instace 17/8/02 would give 3 (taking the date format as dd/mm/yyyy, and todays date as the 14th , 17-14=3.

Post Wed Aug 14, 2002 11:29 am 
 View user's profile Send private message Send e-mail

dbrb2
Board Regular


Joined: 12 Aug 2002
Posts: 28


Status: Offline

 Reply with quote  

I had already tried that I'm afraid, it appears to subtract one date from another, and the output is a date. I was hoping to find a way of outputing a number - so that for instace 17/8/02 would give 3 (taking the date format as dd/mm/yyyy, and todays date as the 14th , 17-14=3.

Post Wed Aug 14, 2002 11:30 am 
 View user's profile Send private message Send e-mail

dbrb2
Board Regular


Joined: 12 Aug 2002
Posts: 28


Status: Offline

 Reply with quote  

Oops ...

Sorry about that

Post Wed Aug 14, 2002 11:32 am 
 View user's profile Send private message Send e-mail

dbrb2
Board Regular


Joined: 12 Aug 2002
Posts: 28


Status: Offline

 Reply with quote  

This works:

=DATEDIF(A1,NOW(),"d")

Post Wed Aug 14, 2002 11:41 am 
 View user's profile Send private message Send e-mail

XL-Dennis
.


Joined: 28 Jul 2002
Posts: 1628
Location: Ístersund, Sweden
Flag: Sweden

Status: Offline

 Reply with quote  

dbrb2,

You may try to use following formula:

=DATEDIF(Date1,Date2,"D") where Date1, Date2 can refer to cells or constant values.

HTH,
Dennis

_________________
Gone fishing

Post Wed Aug 14, 2002 11:46 am 
 View user's profile Send private message

Mark W.
MrExcel MVP


Joined: 11 Feb 2002
Posts: 7146
Location: Austin, Texas USA
Flag: Usa

Status: Offline

 Reply with quote  


quote:

On 2002-08-14 07:41, dbrb2 wrote:
This works:

=DATEDIF(A1,NOW(),"d")



So does =TODAY()-A2... You just need to reformat the cell containing this formula as General.

The formula...

=TODAY()-(A2&"")

can also be used to prevent Excel from interpeting the formula's results as a datevalue.

[ This Message was edited by: Mark W. on 2002-08-14 08:00 ]

Post Wed Aug 14, 2002 11:58 am 
 View user's profile Send private message

dbrb2
Board Regular


Joined: 12 Aug 2002
Posts: 28


Status: Offline

 Reply with quote  

Thanks a lot - sorry abouth going a it over the top posting my question 8 times!

Post Wed Aug 14, 2002 7:05 pm 
 View user's profile Send private message Send e-mail

rodturner
Welcome to the Board


Joined: 19 Aug 2002
Posts: 3


Status: Offline

 Reply with quote  

Simply format the number displyed as a date in number or general format (Format Cells Number) and you will have the days between dates

Post Tue Aug 20, 2002 3:55 am 
 View user's profile Send private message
  Display posts from previous:      

MrExcel Message Board Forum Index -> Excel Questions


Forum Jump:
Jump to:  

Post new topic   Reply to topic
Page 1 of 1



Add To Favorites

 


Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Powered by phpBB: 2.0.4 © 2001 phpBB Group

Need help posting your first question? Read how to post

Need extra help ? Couldn't get the answer you needed ? Get a free quote from our Consulting Team

Download Colo's HTML Maker utility for displaying your Excel Worksheet on the board.

Download VB HTML Maker to post your code on the board


Check out our new index to 485 Excel Articles.


Return to MrExcel Consulting

All contents Copyright 1998-2004 by MrExcel.com
If you believe information posted here is from your copyrighted source, notify us per the Terms of Use
Excel is a registered trademark of the Microsoft Corporation.
MrExcel is a registered trademark of Tickling Keys, Inc.