+ Reply to Thread
Results 1 to 3 of 3

Simplify an IF function

  1. #1
    Registered User
    Join Date
    11-18-2011
    Location
    Tucson
    MS-Off Ver
    Excel 2003
    Posts
    12

    Simplify an IF function

    I have been working on a work schedule that locates the last work over date (over time) on an employee schedule. In column I it lists the last work over, but it cannot be today or in the future. So if the employee is scheduled next week it cannot show that date. I developed this IF function to return a date for that criteria. I will probably have to go back further than 3 months to capture the last work over, so the function gets longer.

    =IF(MAX(E4:H4)<TODAY(),MAX(E4:H4),IF(MAX(E4:G4)<TODAY(),MAX(E4:G4),IF(MAX(E4:F4)<TODAY(),MAX(E4:F4),MAX(E4:F4))))

    Any ideas on making it shorter would be appreciated.

    If you read this Haseeb, thanks again for the function that allows it to query the prior months.
    Attached Files Attached Files
    Last edited by GuF021; 12-17-2011 at 07:16 PM.

  2. #2
    Forum Guru
    Join Date
    05-24-2011
    Location
    India
    MS-Off Ver
    365
    Posts
    2,243

    Re: Simplify an IF function

    Try this,

    I4, copy down.

    =IFERROR(SMALL(E4:H4,COUNTIF(E4:H4,"<="&TODAY())),"")

    Note: TODAY() is a volatile function, so the file will calculate if anything changes on in any open workbook. Enter TODAY() in a cell some where then reference that cells in the formula instead of using multiple times.
    Regards,
    Haseeb Avarakkan

    __________________________________
    "Feedback is the breakfast of champions"

  3. #3
    Registered User
    Join Date
    11-18-2011
    Location
    Tucson
    MS-Off Ver
    Excel 2003
    Posts
    12

    Re: Simplify an IF function

    Works great, Thanks again Haseeb. I worked with the the SMALL and COUNTIF functions after seeing it used on the forum, just could'nt make them work.

+ 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