+ Reply to Thread
Results 1 to 2 of 2

IF column B = closed, then calculate # of days between dates in Column C and Column D

  1. #1
    Registered User
    Join Date
    01-24-2008
    Posts
    7

    IF column B = closed, then calculate # of days between dates in Column C and Column D

    I have a worksheet and within it it has column B which states if a deal is closed or not (Closed is typed in if closed and the cell remains empty if the matter is not closed). Then I have column C with opening date and column D with closing date. I need a formula that will allow me to say if B1 is "Closed" then calculate the number of days difference between column C and column D.

    I think I could use:

    =IF(B1="Closed",(=DATEDIF(c1,d1,"D")),"")

    But it does not work. Any ideas ? Am I trying to mix too many formulas. Any input would be greatly appreciated.

    Thank you

  2. #2
    Forum Contributor Portuga's Avatar
    Join Date
    02-20-2004
    Location
    Portugal
    MS-Off Ver
    365
    Posts
    852
    This works in my machine:

    =IF(B1="Closed",C1-D1,"")

    Format the result cell as number.

    Invert the order if you dont want negative numbers:

    =IF(B1="Closed",D1-C1,"")
    Last edited by Portuga; 04-01-2008 at 05:45 PM.
    If you found the solution to your question. Mark the thread as "Solved"
    Thank everyone that helped you with a valid solution by clicking on their

    There is no such thing as a problem, only a temporary lack of a solution

+ 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