+ Reply to Thread
Results 1 to 6 of 6

Conditional Format based on Year & Month.

  1. #1
    Registered User
    Join Date
    12-19-2012
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    30

    Conditional Format based on Year & Month.

    I'm trying to conditional format based on below.

    Column A has the year & Column B has the month:

    Is there a way to conditional format Column A & B for the following:

    Highlight in Orange a month before the due month.
    Highlight in Green when the month is due.
    Highlight in Red one month past the due month.


    Any help would be appreciated. Thank you.

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: Conditional Format based on Year & Month.

    I think you are going to have to provide quite a bit more details than you have. How do we know when something is due, what does your "year" and "month" look like?
    i would suggest you upload a sample work book, (all sensitive data removed), showing what data you are working with, a few examples of what your expected outcome is, and how you arrived at that
    To attach a file to your post,
    click advanced (next to quick post),
    scroll down until you see "manage file",
    click that and select "add files" (top right corner).
    click "select files" find your file, click "open" click "upload" click 'done" bottom right. click "submit reply"

    Once the upload is completed the file name will appear below the input boxes in this window.
    You can then close the window to return to the new post screen.
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Registered User
    Join Date
    12-19-2012
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    30

    Re: Conditional Format based on Year & Month.

    Thanks for responding -

    Sheet 1 (con 1) has Col A for the year and Col B for the month. I'm trying to conditional format based on the month against the year.

    Sheet 2 (conf 2) - I've created Col C to provide a full date string in order to conditional format (to make life easier). (plan B).

    However, the month and the year is the key thing.

    If something is due in November 2012 - the month should go orange when its October (1 month before), Green in November (month due) & then Red for December (month expired).




    Hope that makes sense.
    Attached Files Attached Files

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: Conditional Format based on Year & Month.

    For the "October" rule, use this...
    =$E$1>DATE(B2,MONTH(DATEVALUE(1&" "&A2&" "&B2))-1,1)
    For the "December"rule, this...
    =$E$1<DATE(B2,MONTH(DATEVALUE(1&" "&A2&" "&B2))+1,1)

  5. #5
    Registered User
    Join Date
    12-19-2012
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    30

    Re: Conditional Format based on Year & Month.

    Is that for "use a formula to determine which cells to format" on the conditional format tab for Sheet 2? If so, would it begin at E2 not E1?

  6. #6
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: Conditional Format based on Year & Month.

    Yes, it is "use formula", and oops sorry, I neglected to say that I put the date (11/1/2012) in its own cell, sorry

+ 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. Return value of the last week of the month based on the year and month
    By stevekho2 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 09-14-2013, 11:04 AM
  2. Conditional Format (month and year) = Today()
    By Scott in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-04-2005, 12:55 PM
  3. [SOLVED] day/month/year in incorrect format for date format
    By M&A_Jack in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 10:05 AM
  4. [SOLVED] day/month/year in incorrect format for date format
    By Peo Sjoblom in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 09-06-2005, 04:05 AM
  5. [SOLVED] day/month/year in incorrect format for date format
    By M&A_Jack in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-05-2005, 10:05 PM

Tags for this Thread

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