Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Teddy
 
Posts: n/a
Default Converting date to numerical and doing calculations

Does anyone know how to convert a date into a single number so that you
can do calcuations with it? For example, Nov,2005 minus January, 2004
equals 23.

  #2   Report Post  
Duke Carey
 
Posts: n/a
Default

I'm guessing that you are counting months between two dates, right?

Take a look at Chip Pearson's site about dates and date calculations:

http://www.cpearson.com/excel/datedif.htm


"Teddy" wrote:

Does anyone know how to convert a date into a single number so that you
can do calcuations with it? For example, Nov,2005 minus January, 2004
equals 23.


  #3   Report Post  
Myrna Larson
 
Posts: n/a
Default

Dates ARE stored as numbers, specifically the number of elapsed days since Dec
31, 1899. If you want the difference in months, you can use the undocumented
DATEDIF function: =DATEDIF(A1,B1,"m")


On 5 Oct 2005 12:58:43 -0700, "Teddy" wrote:

Does anyone know how to convert a date into a single number so that you
can do calcuations with it? For example, Nov,2005 minus January, 2004
equals 23.

  #4   Report Post  
bill k
 
Posts: n/a
Default


dates are actually stored as normal numbers

for instance

a2 has 23/01/2005
a1 has 12/11/2004
both formatted as dates

if you would copy paste and format the pasted cells as numbers you see

that 23/01/2005 is now 38375 and 12/11/2004 is 38303

in a3 enter =a2-a1
formatted as number
result 72

in a4 enter =a1-a2
formatted as number
result -72

if result is ############### then the cell is still formatted as a date
and
you have a negative "date"


--
bill k


------------------------------------------------------------------------
bill k's Profile: http://www.excelforum.com/member.php...nfo&userid=821
View this thread: http://www.excelforum.com/showthread...hreadid=473575

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 10:33 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"