+ Reply to Thread
Results 1 to 5 of 5

difference between dates

  1. #1
    Forum Contributor
    Join Date
    01-25-2005
    Location
    Cardiff, Wales
    MS-Off Ver
    Mac 365 & M/S 365
    Posts
    107

    difference between dates

    Please help,

    I am calculating the difference between two dates, =IF(Q10>1,Q10-E10,"")
    but if one of the cells is empty it's showing #VALUE!.

    Is there a way to stop this happening.

    Many thanks

  2. #2
    Daniel CHEN
    Guest

    Re: difference between dates

    I used your formula and did not have your problem.
    If Q10 is blank, then from your formula, the results is "";
    If E10 is blank, then it returns the date value of the date in Q10.
    IF both are blank, it also returns "".

    If you still have the problem, then try this:
    = if(iserror(yourformula), "", yourformula)
    replace yourformula in above with IF(Q10>1,Q10-E10,"")

    --
    Best regards,
    ---
    Yongjun CHEN
    =================================
    XLDataSoft - Data Analysis Expert, Excel/VBA Specialist
    - - - - www.XLDataSoft.com - - - -
    Free Excel-Based Data Processing Tool is Available for Download
    Free Excel / VBA Training Materials is Available for Download
    =================================
    "Clash" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Please help,
    >
    > I am calculating the difference between two dates,
    > =IF(Q10>1,Q10-E10,"")
    > but if one of the cells is empty it's showing #VALUE!.
    >
    > Is there a way to stop this happening.
    >
    > Many thanks
    >
    >
    > --
    > Clash
    > ------------------------------------------------------------------------
    > Clash's Profile:
    > http://www.excelforum.com/member.php...o&userid=18951
    > View this thread: http://www.excelforum.com/showthread...hreadid=545642
    >




  3. #3

    Re: difference between dates

    Hope this helps:

    =IF(AND(ISNUMBER(Q10),ISNUMBER(E10),Q10>1),Q10-E10,"")

    ed


  4. #4
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,787
    Do you have formulas in E10 and Q10?

  5. #5
    Forum Contributor
    Join Date
    01-25-2005
    Location
    Cardiff, Wales
    MS-Off Ver
    Mac 365 & M/S 365
    Posts
    107
    Quote Originally Posted by daddylonglegs
    Do you have formulas in E10 and Q10?
    Sorry I didn't say.

    Yes, they are to formulas, the two dates are pulled thru from two different spreadsheets.


    I have just used Ed's formula and it cleared up the problem, brilliantly.

    Many thanks everyone.
    Your help was invaluble, as always.
    Last edited by Clash; 05-26-2006 at 03:13 AM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1