+ Reply to Thread
Results 1 to 6 of 6

Having two date return number but exclude negative numbers

  1. #1
    Registered User
    Join Date
    11-21-2013
    Location
    Missouri
    MS-Off Ver
    Excel 2007
    Posts
    8

    Having two date return number but exclude negative numbers

    I'm trying to figure out a formula to use that will exclude negative numbers. I have two dates. I'm trying to find the difference between the two dates assuming there is a date in the first column. At times there will be a situation where the date in A1 is before the date in A2 and it returns a negative number. I'd like to return a blank if there is a blank cell in column A and also return a blank if the return number is a negative.

    Example:

    A1 = 1/15/2013 B1= 1/10/2013 C1(formula) =IF(A1="","",(A1-B1) C1 will then reflect 5

    A2 = (cell is blank) B2= 1/18/2013 C2 (formula) =IF(A2="","",(A2-B2) C2 will then reflect a blank cell

    A3 = 1/5/2013 B3 = 1/15/2013 C3 (formula) =IF(A3="","",(A3-B3) C3 will then reflect -10


    I'm trying to figure out a formula that would also allow C3 to reflect a blank cell since the formula returns a negative.

    Thanks for your help

  2. #2
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.83 (24031120))
    Posts
    8,732

    Re: Having two date return number but exclude negative numbers

    try

    =IF(OR(A3="", A3-B3<0) ,"",(A3-B3))
    Wayne
    if my assistance has helped, and only if you wish to , there is an "* Add Reputation" on the left hand side - you can add to my reputation here

    If you have a solution to your thread - Please mark your thread solved do the following: >
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  3. #3
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,613

    Re: Having two date return number but exclude negative numbers

    in C1:
    Please Login or Register  to view this content.
    and copy down

  4. #4
    Forum Contributor
    Join Date
    12-16-2013
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    109

    Re: Having two date return number but exclude negative numbers

    Similar to previous but using the Datedif function

    =IF(OR(A3=" ",B3=" ",A3<B3)," ",DATEDIF(A3,B3,"d"))
    Last edited by JBeaucaire; 12-31-2013 at 02:08 AM. Reason: Removed unrelated in-post link. Create a signature if you want this content included.

  5. #5
    Registered User
    Join Date
    11-21-2013
    Location
    Missouri
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: Having two date return number but exclude negative numbers

    Awesome...each worked....really appreciate the help!!!

  6. #6
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.83 (24031120))
    Posts
    8,732

    Re: Having two date return number but exclude negative numbers

    excellent , thanks for letting us know

    if my assistance has helped, and only if you wish to , there is a reputation icon * on the left hand side - you can add to my reputation here
    If you have a solution to your thread - Please mark your thread solved do the following: >
    Select Thread Tools-> Mark thread as Solved.

+ 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] VBA to Sort Data and exclude the negative numbers with respect to time during averaging
    By vnzerem in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-18-2013, 12:00 PM
  2. [SOLVED] Determine whether number of positive numbers exceeds number of negative numbers
    By HRBP in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 12-04-2012, 09:49 PM
  3. max number of a spreadsheet but exclude 3 numbers
    By hansonjb in forum Excel Formulas & Functions
    Replies: 14
    Last Post: 01-09-2010, 12:57 PM
  4. Excel 2007 : Exclude negative number
    By berk21 in forum Excel General
    Replies: 2
    Last Post: 11-02-2009, 06:23 PM
  5. Replies: 1
    Last Post: 11-20-2008, 01:52 AM

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