#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 16
Default Working with dates

Trying to subtract dates to determine # of days in inventory. But only want
the calculation to be performed if there is an ending date entered i.e. A2-K4
(A2 equals todays date and K4 equals the ending date) will give me my days in
inventory, but I only want the value if an ending date has been entered into
K4. If no date has been entered, the number of days should remain 0.
Currently, when I extend my formula, it gives me a very high default number
when no ending date has been entered.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default Working with dates

Try this:

=IF(K4=0,0,A2-K4)

--
Biff
Microsoft Excel MVP


"Harley" wrote in message
...
Trying to subtract dates to determine # of days in inventory. But only
want
the calculation to be performed if there is an ending date entered i.e.
A2-K4
(A2 equals todays date and K4 equals the ending date) will give me my days
in
inventory, but I only want the value if an ending date has been entered
into
K4. If no date has been entered, the number of days should remain 0.
Currently, when I extend my formula, it gives me a very high default
number
when no ending date has been entered.



  #3   Report Post  
Posted to microsoft.public.excel.misc
Max Max is offline
external usenet poster
 
Posts: 9,221
Default Working with dates

Think you could get by with:
=IF(K4="",0,A2-K4)
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"Harley" wrote:
Trying to subtract dates to determine # of days in inventory. But only want
the calculation to be performed if there is an ending date entered i.e. A2-K4
(A2 equals todays date and K4 equals the ending date) will give me my days in
inventory, but I only want the value if an ending date has been entered into
K4. If no date has been entered, the number of days should remain 0.
Currently, when I extend my formula, it gives me a very high default number
when no ending date has been entered.

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,202
Default Working with dates

Assuming, like you did, that K4 will have nothing in it (as opposed to 0)
when "no date has been entered"; then this will work also...

=A2-MIN(A2,K4)

Rick


"Max" wrote in message
...
Think you could get by with:
=IF(K4="",0,A2-K4)
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"Harley" wrote:
Trying to subtract dates to determine # of days in inventory. But only
want
the calculation to be performed if there is an ending date entered i.e.
A2-K4
(A2 equals todays date and K4 equals the ending date) will give me my
days in
inventory, but I only want the value if an ending date has been entered
into
K4. If no date has been entered, the number of days should remain 0.
Currently, when I extend my formula, it gives me a very high default
number
when no ending date has been entered.


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
Working with Dates [email protected] Excel Discussion (Misc queries) 2 July 5th 07 11:41 PM
Working with Dates Byron720 Excel Worksheet Functions 3 December 28th 06 12:02 AM
Working with dates Al Excel Worksheet Functions 3 April 21st 06 05:49 PM
working with dates Pe66les Excel Worksheet Functions 3 August 25th 05 12:19 AM
working with dates Phil kelly Excel Discussion (Misc queries) 2 June 21st 05 12:05 PM


All times are GMT +1. The time now is 05:32 AM.

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"