+ Reply to Thread
Results 1 to 5 of 5

Excel 2007 : How to write a formula in a cell as per the following condition?

  1. #1
    Registered User
    Join Date
    09-22-2009
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    27

    How to write a formula in a cell as per the following condition?

    Hi,

    How to write a formula in a cell as per the following condition?

    Cell E10 = Start Date
    Cell F10 = End Date
    Cell H10 = Current Date

    If StartDate (E10) is less or equal to CurrentDate (H10) then
    =SUM(H10-E10+1)
    Else
    =SUM(H10-F10+1)

    I need to write this formula in Cell J10.

    Please help.

  2. #2
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,602

    Re: How to write a formula in a cell as per the following condition?

    This?

    =IF(E10<=H10, H10-E10+1, H10-F10+1)

    Where in H10 you have =TODAY()

  3. #3
    Registered User
    Join Date
    09-22-2009
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    27

    Re: How to write a formula in a cell as per the following condition?

    Quote Originally Posted by zbor View Post
    This?

    =IF(E10<=H10, H10-E10+1, F10-E10+1)

    Where in H10 you have =TODAY()
    Thanks for the help. It accepts the first condition (Though the current date is higher than End Date) where it should accept the second condition.

    Please try to resolve my problem

    Thanks.

  4. #4
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,602

    Re: How to write a formula in a cell as per the following condition?

    Try:

    =IF(H10>F10, F10-E10+1, H10-E10+1)

  5. #5
    Registered User
    Join Date
    09-22-2009
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    27

    [SOLVED] How to write a formula in a cell as per the following condition?

    [QUOTE=zbor;2345613]Try:

    It is okay now. Problem fixed.

    Thanks.
    Last edited by LearnerEXL; 07-18-2010 at 07:14 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