+ Reply to Thread
Results 1 to 4 of 4

Highlight nearest expire date

  1. #1
    Registered User
    Join Date
    09-09-2011
    Location
    kuching, Malaysia
    MS-Off Ver
    Excel 2007
    Posts
    52

    Question Highlight nearest expire date

    Hi All,

    I have a raw of data consists of expire date. I would like the excel to help me control the first expire first out by highlighting the nearest expire date for each materials.

    Note that for each materials there are several batch with different expire date. I want the excel to highlight to me which batch i should use first base on nearest expire date. And also highlight in different color if the batch had expired.

    Example is attached. I had manually highlight suggest batch to use in yellow, and expired batch in red. How should i do it with formula? Perhaps with "conditional formatting"?
    Attached Files Attached Files
    Last edited by nickh1981; 11-07-2013 at 09:28 PM.

  2. #2
    Forum Expert Ace_XL's Avatar
    Join Date
    06-04-2012
    Location
    UAE
    MS-Off Ver
    2016
    Posts
    6,074

    Re: Highlight nearest expire date

    Untested

    In CF use
    =AND(D3>=TODAY(),D3=MIN(IF($F$3:$F$81=F3,$D$3:$D$81)))
    format yellow

    =D3<TODAY()
    format red
    Life's a spreadsheet, Excel!
    Say thanks, Click *

  3. #3
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Highlight nearest expire date

    Assuming each "group" in section B must be treated separately, these CF formulas will work (tested and confirmed):

    (1st Rule, stop if true) RED: =D3<TODAY()
    (2nd Rule) =$D3=MIN(IF(($B$3:$B$81=$B3)*($D$3:$D$81>=TODAY()),$D$3:$D$81))
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  4. #4
    Registered User
    Join Date
    09-09-2011
    Location
    kuching, Malaysia
    MS-Off Ver
    Excel 2007
    Posts
    52

    Re: Highlight nearest expire date

    Thanks both Ace and JB. I've got what i need.

+ 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] email when cell date expire
    By laduk in forum Outlook Formatting & Functions
    Replies: 4
    Last Post: 10-28-2012, 01:10 PM
  2. Replies: 3
    Last Post: 09-13-2012, 10:32 AM
  3. COUNTIF date will expire in a date range
    By neilanderson in forum Excel General
    Replies: 6
    Last Post: 07-31-2012, 02:08 PM
  4. Date Function:contracts expire.
    By LisaS in forum Excel General
    Replies: 1
    Last Post: 07-27-2005, 04:05 PM
  5. Check Expire Date
    By kuanct in forum Excel General
    Replies: 5
    Last Post: 02-24-2005, 11:22 AM

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