ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Working with dates (https://www.excelbanter.com/excel-discussion-misc-queries/157022-working-dates.html)

Harley

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.

T. Valko

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.




Max

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.


Rick Rothstein \(MVP - VB\)

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.




All times are GMT +1. The time now is 11:47 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com