+ Reply to Thread
Results 1 to 4 of 4

Formula Problem: Dates in Two Cells to be Subtracted!

  1. #1
    Registered User
    Join Date
    01-20-2014
    Location
    london, England
    MS-Off Ver
    Excel 2010
    Posts
    49

    Question Formula Problem: Dates in Two Cells to be Subtracted!

    I have two dates in to different cells, I'm using the Formula below to show the amount of days between the two dates.

    Please Login or Register  to view this content.
    Column H is date stock was sent
    Column G is date stock came in

    However, if there is not a date in H (eg, stock has not been sent out yet) then it comes out with a negative number. I want to extend my formula so that if the cell has 0 or less in it it will remain blank.

    Can this be done??

    I tried the code below and it doesn't work...

    Please Login or Register  to view this content.

  2. #2
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Formula Problem: Dates in Two Cells to be Subtracted!

    If you use this formula then the cell remains blank unless you have entries in both G10 and H10

    =IF(COUNT(G10,H10)=2,H10-G10,"")
    Audere est facere

  3. #3
    Registered User
    Join Date
    04-07-2014
    Location
    Taipei, Taiwan
    MS-Off Ver
    2011
    Posts
    17

    Re: Formula Problem: Dates in Two Cells to be Subtracted!

    Try this:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Edit: Oops, late again. And yes, daddylongleg's approach is more elegant :D

  4. #4
    Registered User
    Join Date
    01-20-2014
    Location
    london, England
    MS-Off Ver
    Excel 2010
    Posts
    49

    Re: Formula Problem: Dates in Two Cells to be Subtracted!

    @ Daddylonglegs: Absolute star, worked perfectly!

    Could you possibly show everyone here how you found your answer and let us know what the correct way tp lay out the formula was?

    Just so everyone here can learn from it for next time

    Thanks again!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Neighbouring Numbers subtracted from one another
    By Schroeder70 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-07-2013, 01:12 PM
  2. [SOLVED] Problem will CELLS(Row,Col).Value when accessing dates
    By bluesplayer43 in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 07-18-2012, 08:50 AM
  3. How to exclude 2 choices from being subtracted.
    By jgomez in forum Excel General
    Replies: 10
    Last Post: 01-28-2011, 05:15 PM
  4. Replies: 1
    Last Post: 01-26-2011, 04:28 AM
  5. Replies: 1
    Last Post: 03-23-2005, 12:06 PM

Tags for this Thread

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