ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Date formual issue (https://www.excelbanter.com/excel-worksheet-functions/181257-date-formual-issue.html)

martyn

Date formual issue
 
Hi everyone

I have two colums with dates in and I want to subtract one from the other so
so I can get hte dumber of days between the two, this is the east part. The
problem I have is when one of the colums is blank I want to use todays date
so I can avoid #VALUE! being returned, I been reading a looking up posts here
for the best part of two hours and can not find the answer, can anyone help
me please?

Many thanks
Martyn

Lars-Åke Aspelin[_2_]

Date formual issue
 
On Tue, 25 Mar 2008 12:31:12 -0700, Martyn
wrote:

Hi everyone

I have two colums with dates in and I want to subtract one from the other so
so I can get hte dumber of days between the two, this is the east part. The
problem I have is when one of the colums is blank I want to use todays date
so I can avoid #VALUE! being returned, I been reading a looking up posts here
for the best part of two hours and can not find the answer, can anyone help
me please?

Many thanks
Martyn



Try this:

Replace B1 with IF(ISBLANK(B1),TODAY(),B1)

To get the number of days between two dates you just have to subtract
them.

=IF(ISBLANK(B1),TODAY(),B1)-IF(ISBLANK(A1),TODAY(),A1)

Hope this helps / Lars-Åke

Sandy Mann

Date formual issue
 
If you really want to use today's date then use:

=A1-(MAX(TODAY(),B1))

or:

=MAX(A1,TODAY())-B1

depending of which date will be blank or:

=IF(COUNT(A16:B16)<2,"",A16-B16)

to only calculte when there are two dates showing.

--
HTH

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings


Replace @mailinator.com with @tiscali.co.uk


"Martyn" wrote in message
...
Hi everyone

I have two colums with dates in and I want to subtract one from the other
so
so I can get hte dumber of days between the two, this is the east part.
The
problem I have is when one of the colums is blank I want to use todays
date
so I can avoid #VALUE! being returned, I been reading a looking up posts
here
for the best part of two hours and can not find the answer, can anyone
help
me please?

Many thanks
Martyn





All times are GMT +1. The time now is 02:14 AM.

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