Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
Steve
 
Posts: n/a
Default Negative return in =DATEDIF function

Is it possible to display the result of a negative DATEDIF function? I
am checking a column of warranty expiration dates against the current
date, and displaying that in an adjacent column. When the item is past
its expiration it shows the #NUM! error. How would I format this to
show the number of days past its expiration?

  #2   Report Post  
Posted to microsoft.public.excel.misc
Dave O
 
Posts: n/a
Default Negative return in =DATEDIF function

Instead of using a formula that returns an error when numbers are
negative you might use a simple subtraction instead: for instance if
the expiration is 1/15/2006 in cell A1 and today's date is 3/2/2006,
you might use the formula
=TODAY()-A1

This returns a positive 46, though, and it sounds like you want to show
a negative number when the expiration date is in the past, so try
=0-(TODAY()-A1)

If your expiration date is in the future, that formula shows a positive
number. Does that resolve your question?

  #3   Report Post  
Posted to microsoft.public.excel.misc
Steve
 
Posts: n/a
Default Negative return in =DATEDIF function

That does work. I formatted the cells to make negative numbers red, so
it is more clear at a glance.

Thanks fot the help!

  #4   Report Post  
Posted to microsoft.public.excel.misc
Duke Carey
 
Posts: n/a
Default Negative return in =DATEDIF function

Why not just subtract the expiry dates from today's date? With the date in
D2, use

=today()-D2

Format the cell as general



"Steve" wrote:

Is it possible to display the result of a negative DATEDIF function? I
am checking a column of warranty expiration dates against the current
date, and displaying that in an adjacent column. When the item is past
its expiration it shows the #NUM! error. How would I format this to
show the number of days past its expiration?


  #5   Report Post  
Posted to microsoft.public.excel.misc
Mark Lincoln
 
Posts: n/a
Default Negative return in =DATEDIF function

All you really need to do is subtract the current date from the
warranty expiration date. If the result is less than zero, the
warranty has expired.

If you want to show the number of days past expiration, you could use
something like this, using B8 for an example:

=IF(B8<TODAY(),ABS(B8-TODAY()),"")

Format the cell as General.

This shows blank if the warranty has not expired, and the number of
days past warranty once expired.



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
Function to return last entry in a column series? Tory Excel Worksheet Functions 2 November 7th 05 03:16 PM
How can I use the vlookup function to return a sum of the values? Chaandni Excel Discussion (Misc queries) 4 November 7th 05 03:05 PM
Is there a function to return all Thursdays in a given month/yr Week Dates from nth day of week Excel Worksheet Functions 11 August 11th 05 05:09 AM
Automatically up date time in a cell Mark Excel Discussion (Misc queries) 5 May 12th 05 12:26 AM
need IF function to return 0 if it finds a one out of three words aledger Excel Worksheet Functions 3 March 1st 05 12:47 AM


All times are GMT +1. The time now is 12:06 AM.

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

About Us

"It's about Microsoft Excel"