+ Reply to Thread
Results 1 to 7 of 7

Excel 2007 : Conditional formatting based on another cells contents

  1. #1
    Registered User
    Join Date
    07-11-2010
    Location
    Auckland, New Zealand
    MS-Off Ver
    Excel 2007
    Posts
    16

    Conditional formatting based on another cells contents

    Hi,

    I have a worksheet with the entire year on it, with date(H1) and day(H2) of the week, and hours worked in the column below(H3:H63). Our pay day is thursday and I want a conditional formula in each cell that will look at the day of the week, if H2=Wed then place a border at the right hand side of H3:H63, to denote end of last week, start of next week.

    I want a conditional format so that when I use this sheet next year, I can put in the date in the top right corner, the days will update for the new year, and the lines will reappear in the correct place.

    Is it possible, or will I have to use an IF statement in each cell? (Waaa)

    Cheers
    Last edited by SkeptiCol; 11-18-2010 at 04:07 PM. Reason: Clarification

  2. #2
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Conditional formatting based on another cells contents

    You can set the conditional formatting in H3:H63 with a formula that looks at H1.

    Select the range H3:H63 and use

    =WEEKDAY(H$1)=4

    format as required
    Audere est facere

  3. #3
    Registered User
    Join Date
    07-11-2010
    Location
    Auckland, New Zealand
    MS-Off Ver
    Excel 2007
    Posts
    16

    Re: Conditional formatting based on another cells contents

    I have entered the formula, but nothing happened. What part of the formula is referring to wednesay (the day in H2)?

    Also I tried to copy across a group of cells and the range didn't move either (I1, J1, K1 etc), they all kept referring to H1 as though i had entered an absolute reference?

    I've included an examble sheet, hopefully it will not do for you what it is not doing for me (so I don't look like an idiot basically), and you can figure why!

  4. #4
    Registered User
    Join Date
    07-11-2010
    Location
    Auckland, New Zealand
    MS-Off Ver
    Excel 2007
    Posts
    16

    Re: Conditional formatting based on another cells contents

    The file didn't upload!?!

  5. #5
    Registered User
    Join Date
    07-11-2010
    Location
    Auckland, New Zealand
    MS-Off Ver
    Excel 2007
    Posts
    16

    Re: Conditional formatting based on another cells contents

    this time?
    Attached Files Attached Files

  6. #6
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Conditional formatting based on another cells contents

    I'm not sure what you entered but the formula is now surrounded with quotes (which you don't want) - that sometimes means you didn't use the = sign.

    I cleared the existing conditional formatting and then selected the whole range C3:M50 and used this formula

    =WEEKDAY(C$1)=4

    Using C$1 means that the formula will adjust to refer to D1, E1 etc across the column but $ fixes the 1 so down the column every cell still looks at C1

    Although you have the date in C1 and the day in C2, the cell contents are actually the same - formatting makes one show the full date and the other just the day.....so you can refer to C1 or C2...it doesn't matter

    WEEKDAY returns a value 1 to 7, Sunday to Saturday so 4 is a Wednesday, see attached

    Change the date in A1 to see how the formatting changes.....
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    07-11-2010
    Location
    Auckland, New Zealand
    MS-Off Ver
    Excel 2007
    Posts
    16

    Talking Re: Conditional formatting based on another cells contents

    "We're not Worthy!
    We're not Worthy!
    We're not Worthy!
    We're Scum!
    We Suck!"

    worked first time, highlighted area, used= and waa-laa

    Thanks for the extra explainations too, really helped deepen my understanding, rather than just giving a straight answer.

    AWESOME!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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