Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
RC RC is offline
external usenet poster
 
Posts: 39
Default Difference between fixed and variable date

I have a date difference formula =DATEDIF(B1,TODAY(),"M") which works
fine.
I thought I would amend the 'Today' bit of the formula to solve the problem
where I want to know the number of months between a variable date and a fixed
date.

e.g. variable date Fixed Date Months Difference
15/06/2006 31/04/2007 ?
22/09/2006 31/04/2007 ?
03/02/2006 31/04/2007 ?

Can you advise please.
  #2   Report Post  
Posted to microsoft.public.excel.programming
Ian Ian is offline
external usenet poster
 
Posts: 238
Default Difference between fixed and variable date

Two options (ther may be others).
1. Use another cell for the fixed date and refer to it =DATEDIF(B1,C1,"M")
2. Hard code the fixed date into the formula
=DATEDIF(B1,DATE(2006,12,8)=,"M")

The first option may be easier if you want to change the fixed date at any
time, but the second option is tidier as it doesn't need any extra cells in
the sheet.
--
Ian
--
"RC" wrote in message
...
I have a date difference formula =DATEDIF(B1,TODAY(),"M") which works
fine.
I thought I would amend the 'Today' bit of the formula to solve the
problem
where I want to know the number of months between a variable date and a
fixed
date.

e.g. variable date Fixed Date Months Difference
15/06/2006 31/04/2007 ?
22/09/2006 31/04/2007 ?
03/02/2006 31/04/2007 ?

Can you advise please.



  #3   Report Post  
Posted to microsoft.public.excel.programming
RC RC is offline
external usenet poster
 
Posts: 39
Default Difference between fixed and variable date



Thanks for the formulae. One issue I seem to get a lot and don't understand
why is that the resulting cell gives an answer of #VALUE!. I try to change
the result cell format to a number but nothing changes. What could cause
this?

"Ian" wrote:

Two options (ther may be others).
1. Use another cell for the fixed date and refer to it =DATEDIF(B1,C1,"M")
2. Hard code the fixed date into the formula
=DATEDIF(B1,DATE(2006,12,8)=,"M")

The first option may be easier if you want to change the fixed date at any
time, but the second option is tidier as it doesn't need any extra cells in
the sheet.
--
Ian
--
"RC" wrote in message
...
I have a date difference formula =DATEDIF(B1,TODAY(),"M") which works
fine.
I thought I would amend the 'Today' bit of the formula to solve the
problem
where I want to know the number of months between a variable date and a
fixed
date.

e.g. variable date Fixed Date Months Difference
15/06/2006 31/04/2007 ?
22/09/2006 31/04/2007 ?
03/02/2006 31/04/2007 ?

Can you advise please.




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Difference between fixed and variable date

I get #Value if one of the the first two arguments are not a date. It could
be the value is stored as a string/text instead of an actual date. If
Excel can interpret the string as a date, it still works for me, but if not,
then I get #Value.

--
Regards,
Tom Ogilvy



"RC" wrote in message
...


Thanks for the formulae. One issue I seem to get a lot and don't
understand
why is that the resulting cell gives an answer of #VALUE!. I try to
change
the result cell format to a number but nothing changes. What could cause
this?

"Ian" wrote:

Two options (ther may be others).
1. Use another cell for the fixed date and refer to it
=DATEDIF(B1,C1,"M")
2. Hard code the fixed date into the formula
=DATEDIF(B1,DATE(2006,12,8)=,"M")

The first option may be easier if you want to change the fixed date at
any
time, but the second option is tidier as it doesn't need any extra cells
in
the sheet.
--
Ian
--
"RC" wrote in message
...
I have a date difference formula =DATEDIF(B1,TODAY(),"M") which
works
fine.
I thought I would amend the 'Today' bit of the formula to solve the
problem
where I want to know the number of months between a variable date and a
fixed
date.

e.g. variable date Fixed Date Months
Difference
15/06/2006 31/04/2007 ?
22/09/2006 31/04/2007 ?
03/02/2006 31/04/2007 ?

Can you advise please.






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


Similar Threads
Thread Thread Starter Forum Replies Last Post
How fill series containing one variable and one fixed value in XL nomad Excel Discussion (Misc queries) 2 September 18th 09 09:25 PM
Fixed column- Variable row # Vasilis Tergen Excel Discussion (Misc queries) 3 December 2nd 06 06:10 PM
Variable column to fixed array asaylor Excel Worksheet Functions 0 August 9th 06 05:28 PM
From a fixed cell to a variable [email protected] Excel Programming 8 July 21st 06 02:14 PM
Changing fixed date with a variable in a ODBC Query Hande & Tolga Excel Programming 1 September 22nd 03 11:00 AM


All times are GMT +1. The time now is 08:07 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"