+ Reply to Thread
Results 1 to 6 of 6

Formula for conditional formatting of expiration date in 2 months

  1. #1
    Registered User
    Join Date
    07-26-2019
    Location
    Virginia, USA
    MS-Off Ver
    2016
    Posts
    3

    Formula for conditional formatting of expiration date in 2 months

    Hi,
    I am trying to create a formula to conditionally format expiration dates that occur in 2 months. In Column A, I have =Today(). In Column B, I have various expiration dates in format MM/YY. I've tried =AND(DATEDIF($B2,$A$2,"m")>2,$B2<1). Any help is greatly appreciated!

  2. #2
    Valued Forum Contributor
    Join Date
    06-02-2012
    Location
    London, England
    MS-Off Ver
    365
    Posts
    397

    Re: Formula for conditional formatting of expiration date in 2 months

    If I've understood correctly, maybe this will help
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    B.

  3. #3
    Valued Forum Contributor
    Join Date
    07-14-2017
    Location
    Poland
    MS-Off Ver
    Office 2010
    Posts
    528

    Re: Formula for conditional formatting of expiration date in 2 months

    Maybe it will be okay.
    A1 =Today()
    Expiration dates in kol. B from B1.
    Select all dates in col. B.
    Formula for conditional formatting
    Please Login or Register  to view this content.
    Best Regards,
    Maras.

  4. #4
    Registered User
    Join Date
    07-26-2019
    Location
    Virginia, USA
    MS-Off Ver
    2016
    Posts
    3
    Unfortunately this did not work. I am able to use the built in conditional formatting to highlight the dates that occur in “next month”. I want it to also highlight the dates that expire in 2 months. So in July, the worksheet highlights expiration dates in Aug 2019. I want it to highlight expiration dates in Sep 2019 too.

    Quote Originally Posted by BanginMyHeadOnMyDesk View Post
    If I've understood correctly, maybe this will help
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    B.

  5. #5
    Registered User
    Join Date
    07-26-2019
    Location
    Virginia, USA
    MS-Off Ver
    2016
    Posts
    3
    Unfortunately this did not work. I am able to use the built in conditional formatting to highlight the dates that occur in “next month”. I want it to also highlight the dates that expire in 2 months. So in July, the worksheet highlights expiration dates in Aug 2019. I want it to highlight expiration dates in Sep 2019 too.

    Quote Originally Posted by maras_mak View Post
    Maybe it will be okay.
    A1 =Today()
    Expiration dates in kol. B from B1.
    Select all dates in col. B.
    Formula for conditional formatting
    Please Login or Register  to view this content.

  6. #6
    Forum Expert
    Join Date
    03-20-2015
    Location
    Primarily UK, sometimes NL
    MS-Off Ver
    Work: Office 365 / Home: Office 2010
    Posts
    2,405

    Re: Formula for conditional formatting of expiration date in 2 months

    Welcome to the forum.
    If I understand your later posts correctly, you don't want to highlight dates 'within the next 61 days' but dates in the next two calendar months, regardless of how many days in the future they are. If that's correct, read on. If I'm wrong, please let us know.

    To highlight all expiry dates in next month, use this as your CF formula:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    To highlight those in the following month, change the 1 to 2:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    To highlight both, combine them with OR:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Alternatively, you can use AND:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    The advantage of this second formula is that you can easily expand it to highlight the next 3 months, 4 months, etc, just by changing the last number. The 'Or' formula would quickly become unwieldy for those cases. I know that's not what you're asking for right now, but maybe it's of use for the future.

    Hope that helps.
    Regards,
    Aardigspook

    I recently started a new job so am a bit busy and may not reply quickly. Sorry - it's not personal - I will reply eventually.
    If your problem is solved, please go to 'Thread Tools' above your first post and 'Mark this Thread as Solved'.
    If you use commas as your decimal separator (1,23 instead of 1.23) then please replace commas with semi-colons in your formulae.
    You don't need to give me rep if I helped, but a thank-you is nice.

+ 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. Conditional Formatting for Expiration
    By mr ray in forum Excel General
    Replies: 2
    Last Post: 04-17-2019, 09:53 AM
  2. Use Hyperlink to send email 6 months before expiration date
    By mcivli65 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 10-28-2015, 01:24 PM
  3. [SOLVED] Data bar conditional formatting based as expiration date
    By darkmirko in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 06-23-2015, 04:37 PM
  4. [SOLVED] Formula about expiration date according months?
    By momchil.vladov in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-17-2014, 09:14 AM
  5. Expiration Date Formulas or Conditional Formatting
    By alexandrao32 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-13-2013, 11:02 AM
  6. Replies: 2
    Last Post: 06-11-2012, 06:08 PM
  7. Setting up an "expiration date warning" conditional formatting
    By elmaestrocubano in forum Excel General
    Replies: 2
    Last Post: 05-08-2012, 04:21 PM

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