+ Reply to Thread
Results 1 to 2 of 2

Getting the name of the closest 'job to do' based on dates

  1. #1
    Registered User
    Join Date
    11-30-2009
    Location
    england
    MS-Off Ver
    Excel 2003
    Posts
    30

    Getting the name of the closest 'job to do' based on dates

    Hello,

    I have a column from A1:A100 that has a list of jobs to do throughout the future
    I have a column from B1:B100 that lists the days until i have to do the jobs by (this is based off the dates column going from D1:D100)

    In cell C1 i would like a formula that brings up the closest job based on how close the date of the job is to now. Eg.

    File database -6
    Check resources -2
    Find new substitute 15
    Re-address tabs 87
    Locate server branch 89

    So the formula should bring up 'Find new substitute' as that is the closest job.

    Just to confirm -is there a way to ignore negative values?- as i only want FUTURE jobs to be part of the formula. A negative would indicate the date has passed and is quite useless. My current formula is: {INDEX(A1:A100;MATCH(SMALL(B1:B100;ROW());B1:B100;0))} but this is quite useless. If i have 100 jobs it obviously works fine but if there are any blank cells it picks up the '-40219' amount. i don't want to keep moderating the formula all the time.





    P.S my formula is in Openoffice but i can adjust it from any excel one. But please, NO MACROS!

    Thank you guys!

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Getting the name of the closest 'job to do' based on dates

    To find the first postitive value (assuming your numbers in Column B are in ascending order)

    =INDEX($A$1:$A$100,MATCH(TRUE,INDEX($B$1:$B$100>0,0),0))

    or if not in ascending order:

    =INDEX($A$1:$A$100,MATCH(MIN(IF($B$1:$B$100>0,$B$1:$B$100),$B$1:$B$100))

    confirmed with CTRL+SHIFT+ENTER
    Last edited by NBVC; 04-26-2010 at 04:38 PM.
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

+ 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