Thanks:  0
Likes:  0

# Thread: Another date question? Thanks smozgur and Dave. Problem So

1. Hi all!

Column E = Date Opened
Column F = Date Closed
Column O = Difference in days

The above is fine...

Here's my problem...

Ex.
Cell E5 = 04/02/2002
Cell F5 = EMPTY or ""

I would like to display the days opened in
Cell O5

Meaning Today() - F5

The formula I am trying to use is giving me the #NAME?

=IF(AND(val(E5)<>0,val(F5)=0),NOW()-E5,F5-E5)

If E5 contains a date and F5 does not contain a date then formula needs to return the difference in days between Now - E5

Thanks for the help!

Tom

[ This Message was edited by: TsTom on 2002-04-06 11:07 ]

[ This Message was edited by: TsTom on 2002-04-06 11:23 ]

2. val is not Excel function (if you didnot do it in a module), just remove them, also you dont need a function like val there. Try using this:

=IF(AND(E5<>0,F5=0),TODAY()-E5,F5-E5)

regards

3. You may need something like

=IF(AND(E5>0,F5=0),E5-TODAY(),F5-E5)

4. PS:
val = VALUE in excel

5. Thanks guys.
That did solve my problem.

6. Nice to hear that.

## User Tag List

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•