![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Board Regular
Join Date: Mar 2002
Location: Cincinnati, Ohio, USA
Posts: 6,824
|
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 |
|
BatCoder
Join Date: Feb 2002
Location: Turkey
Posts: 764
|
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 |
|
Board Regular
Join Date: Feb 2002
Location: Calgary, Alberta Canada
Posts: 2,065
|
You may need something like =IF(AND(E5>0,F5=0),E5-TODAY(),F5-E5) |
|
|
|
|
|
#4 |
|
BatCoder
Join Date: Feb 2002
Location: Turkey
Posts: 764
|
PS:
val = VALUE in excel |
|
|
|
|
|
#5 |
|
Board Regular
Join Date: Mar 2002
Location: Cincinnati, Ohio, USA
Posts: 6,824
|
Thanks guys.
That did solve my problem. |
|
|
|
|
|
#6 |
|
BatCoder
Join Date: Feb 2002
Location: Turkey
Posts: 764
|
Nice to hear that.
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|