+ Reply to Thread
Results 1 to 6 of 6

Conditional formatting based on value in diff sheet

  1. #1
    Registered User
    Join Date
    03-12-2005
    Posts
    42

    Conditional formatting based on value in diff sheet

    Hi all,

    I'm looking to have conditional formatting on Sheet3 if any of the dates in Sheet1 A1:A100 match DAY in current cell...

    On sheet three I have a calendar type setup with dates for each month. On the first sheet column A is used to list days absent. What I would like is for sheet three to change the color of the cell if the date is listed on sheet one. I know this is not the best program for something like this, but hoping I, with your help, can make it work.

    So for example: Sheet 3, cell B5 would change to red because listed on Sheet 1.

    Sheet is attached. Thanks in advance.
    Attached Files Attached Files

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

    Re: Conditional formatting based on value in diff sheet

    B5 doesn't have a date in it, so that has to be fixed. I changed the first month calendar so that every cell actually has a date in it from 2009. 1/1/2009, 1/2/2009, etc. Then I formatted the cells to display only the DAY, so it looks the way you had it originally, but it's dates now.

    Then I applied a corrected CF formula so the cells with dates that match dates in the range sheet1data will light up.

    Take a look. You can do the rest of the months.
    Attached Files Attached Files
    _________________
    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!)

  3. #3
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,705

    Re: Conditional formatting based on value in diff sheet

    I have set up the conditional formatting for you for January. It has to be set up separately for each month. Also, note that your date list is 2009 and Sheet3 is dates in 2010. I added a date in 2010 to Sheet1 to test it for January 1.

    Conditional formatting cannot refer to cell references on other sheets unless you create a named range. I named Sheet1 Column A as "DateList". Then for each cell on Sheet3, I determine the date by adding the day number to the date in the header and subtract 1. Then I count how many times that date appears in DateList. If it's >0, then the formatting turns red.

    If you are not familiar with conditional formatting or how COUNTIF works or named ranges, let me know. The interface for conditional formatting is quite different bewteen 2003 and 2007; what version are you using?
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    03-12-2005
    Posts
    42

    Re: Conditional formatting based on value in diff sheet

    I am using 2003, it looks like these are exactly what I was looking for. Seems so simple now!! I'll review and post back if I have any issues...thanks so much for the help!!!

  5. #5
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,705

    Red face Re: Conditional formatting based on value in diff sheet

    JBeaucaire has a solution that improves the overall approach, by using dates in the calendars for each month. This solves the problem of having to calculate each date, and also allows you to have a single conditional formatting formula to apply to all months. Although my solution is instructive, that one is better.

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

    Re: Conditional formatting based on value in diff sheet

    Lots of ideas here, thanks for the kudos, 6StringJazzer.

    ==========
    Shikamikamoomoo, if that takes care of your need, be sure to EDIT your original post, click Go Advanced and mark the PREFIX box [SOLVED].


    (Also, use the blue "scales" icon in our posts to leave Reputation Feedback, it is appreciated. It is found across from the "time" in each of our posts.)

+ 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