+ Reply to Thread
Results 1 to 9 of 9

Conditional Formatting using the intersection of Two Values

  1. #1
    Registered User
    Join Date
    05-06-2016
    Location
    Liverpool, UK
    MS-Off Ver
    MS Office 365
    Posts
    10

    Conditional Formatting using the intersection of Two Values

    Hi everybody,

    I am currently working on a new spreadsheet and I would like to add conditional formatting to highlight today's date.

    Simple enough, however, the date is split with the first row showing the days of 1 to 31(number format) and the first column shows the months Apr-16 to Mar-17(MMM-YY format) so would need to look up both of the values and then highlight the value where they meet.

    I am using shading to highlight the weekends so looking for an alternative to highlight the date, possibly change the cell formatting so that it is highlighted with a red box.

    Thank you,

    S

    PS - Please disregard the red box
    Attached Files Attached Files
    Last edited by savis; 05-06-2016 at 08:33 AM. Reason: Attachment Added

  2. #2
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Conditional Formatting using the intersection of Two Values

    When working with dates and times you must always post an example.



    Attach a sample workbook. Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window (or use the paperclip icon).
    My General Rules if you want my help. Not aimed at any person in particular:

    1. Please Make Requests not demands, none of us get paid here.

    2. Check back on your post regularly. I will not return to a post after 4 days.
    If it is not important to you then it definitely is not important to me.

  3. #3
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: Conditional Formatting using the intersection of Two Values

    Quote Originally Posted by mehmetcik View Post
    When working with dates and times you must always post an example.
    Not necessary

    Assuming that the day numbers are in row B1:B32 and months are in A2:A13, use this formula as a conditional formatting rule.

    =AND(B$1=DAY(TODAY()),MONTH($A2)=MONTH(TODAY()),YEAR($A2)=YEAR(TODAY()))

  4. #4
    Registered User
    Join Date
    05-06-2016
    Location
    Liverpool, UK
    MS-Off Ver
    MS Office 365
    Posts
    10

    Re: Conditional Formatting using the intersection of Two Values

    Sorry, I have now added a sample of the spreadsheet
    Last edited by savis; 05-06-2016 at 08:33 AM.

  5. #5
    Registered User
    Join Date
    05-06-2016
    Location
    Liverpool, UK
    MS-Off Ver
    MS Office 365
    Posts
    10

    Re: Conditional Formatting using the intersection of Two Values

    Quote Originally Posted by jason.b75 View Post
    Not necessary

    Assuming that the day numbers are in row B1:B32 and months are in A2:A13, use this formula as a conditional formatting rule.

    =AND(B$1=DAY(TODAY()),MONTH($A2)=MONTH(TODAY()),YEAR($A2)=YEAR(TODAY()))
    That formulae works great, thank you

  6. #6
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,535

    Re: Conditional Formatting using the intersection of Two Values

    Assuming that the instructions given in the file meant that you wanted L3 and M3, as opposed to L4, bordered in red, use the following CF rule (for the right side of the box) in addition to Jason's:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Attached is a copy of your file with both rules applied.
    Let me know if you have any questions.
    Attached Files Attached Files
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

  7. #7
    Registered User
    Join Date
    05-06-2016
    Location
    Liverpool, UK
    MS-Off Ver
    MS Office 365
    Posts
    10

    Re: Conditional Formatting using the intersection of Two Values

    Thank you

  8. #8
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,535

    Re: Conditional Formatting using the intersection of Two Values

    You're welcome and thank you for the feedback. If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. I hope that you have a good day.

  9. #9
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: Conditional Formatting using the intersection of Two Values

    Quote Originally Posted by JeteMc View Post
    Assuming that the instructions given in the file meant that you wanted L3 and M3, as opposed to L4, bordered in red, use the following CF rule (for the right side of the box)
    Or a single rule that works for both boxes

    =AND(MAX($B$1:B$1)=DAY(TODAY()),MONTH($A2)=MONTH(TODAY()),YEAR($A2)=YEAR(TODAY()))

    Another method came to mind after posting my original suggestion, which uses less functions (single rule version to format both boxes).

    =DATEVALUE(MAX($B$1:B$1)&TEXT($A2,"\/mm/yyyy"))=TODAY()

    I was trying to get it down to something on the lines of =($A2+B$1-1)=TODAY() but that would be prone to errors several times per year, and I couldn't see a way to correct it without making it longer than the original formula.

+ 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] Intersection of two sets of values?
    By studiosa in forum Excel General
    Replies: 10
    Last Post: 06-13-2016, 11:01 PM
  2. Replies: 7
    Last Post: 04-10-2016, 11:24 AM
  3. Formatting Cells with Date or Text Values in a Conditional Formatting Formula
    By Phil Hageman in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-15-2014, 09:36 AM
  4. Lookup Intersection Of Values
    By rflooring in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-31-2014, 01:36 AM
  5. Plotting Intersection of two Values
    By AndrewBennett in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 03-25-2014, 01:29 PM
  6. Replies: 1
    Last Post: 07-16-2013, 06:41 PM
  7. [SOLVED] intersection of 3 Values
    By hassan khansa in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 04-10-2013, 08:15 AM

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