+ Reply to Thread
Results 1 to 6 of 6

Thread: Format cell based on date look up data

  1. #1
    Registered User
    Join Date
    07-19-2010
    Location
    Huddersfield, UK
    MS-Off Ver
    Excel 2003, 2007
    Posts
    34

    Format cell based on date look up data

    I have a file which has a list of accounts, which is updated daily with data. I'm trying to format a cell, based on data in relation to todays date - basically so by a quick glance I can see who has not submitted data for today.

    Attached is an example file.

    I want to format the account name in colA, to look along row2, find todays date, and see if there is any data in the coresponding cells

    So for my example file - AccountA, it would look for today (6th Apr), and see if there is data in cells H3&H4. There is, so no change.
    AccountB has no data in todays cells (cells H6&H7), so the Account name in cell A needs to be highlighted.

    I can get the formula working for looking at a specific cell, but don't know how to make do like a 'vlookup' along row2, to find the date before looking if there's any data in that column.


    Hope that makes sense

    Thanks in advance.
    Attached Files Attached Files
    Last edited by dancing-shadow; 04-07-2011 at 10:53 AM.

  2. #2
    Forum Guru sweep's Avatar
    Join Date
    04-03-2007
    Location
    Location: Location:
    MS-Off Ver
    3.0
    Posts
    2,472

    Re: Format cell based on date look up data

    Hi,

    You could use this formula

    =COUNT(INDEX($C$3:$N$3,MATCH(TODAY(),$C$2:$N$2,0)),INDEX($C$4:$N$4,MATCH(TODAY(),$C$2:$N$2,0)))<2

    to activate the conditional formatting.
    Last edited by sweep; 04-06-2011 at 11:12 AM.
    Please disregard anything in the above post. It may well have been edited without my consent, as has been the case with several posts and threads recently.

  3. #3
    Registered User
    Join Date
    07-19-2010
    Location
    Huddersfield, UK
    MS-Off Ver
    Excel 2003, 2007
    Posts
    34

    Re: Format cell based on date look up data

    Quote Originally Posted by sweep View Post
    =COUNT(INDEX($C$3:$N$3,MATCH(TODAY(),$C$2:$N$2,0)),INDEX($C$4:$N$4,MATCH(TODAY(),$C$2:$N$2,0)))<2
    Works perfectly!!

    Is there a way to make it look whether there data in either of the cells (eg. row 3 OR row 4), as sometimes I have one figure/data but not both, and I'm only interested if there is no data at all in either cell.


    Many thanks

  4. #4
    Forum Guru sweep's Avatar
    Join Date
    04-03-2007
    Location
    Location: Location:
    MS-Off Ver
    3.0
    Posts
    2,472

    Re: Format cell based on date look up data

    Yup,

    =COUNT(INDEX($C$3:$N$3,MATCH(TODAY(),$C$2:$N$2,0)),INDEX($C$4:$N$4,MATCH(TODAY(),$C$2:$N$2,0)))=0

    will be true when there's nothing in either cell
    Please disregard anything in the above post. It may well have been edited without my consent, as has been the case with several posts and threads recently.

  5. #5
    Registered User
    Join Date
    07-19-2010
    Location
    Huddersfield, UK
    MS-Off Ver
    Excel 2003, 2007
    Posts
    34

    Re: Format cell based on date look up data

    Quote Originally Posted by sweep View Post
    =COUNT(INDEX($C$3:$N$3,MATCH(TODAY(),$C$2:$N$2,0)),INDEX($C$4:$N$4,MATCH(TODAY(),$C$2:$N$2,0)))=0
    Awesome-sauce :D

    Many super thanks for your help, you've saved me a lot of time

  6. #6
    Registered User
    Join Date
    07-19-2010
    Location
    Huddersfield, UK
    MS-Off Ver
    Excel 2003, 2007
    Posts
    34

    Re: Format cell based on date look up data

    Having found the above formula to work perfectly, I've also realised I need it to miss-out Saturday/Sundays. So that if today's date falls on a Monday, the formula needs to look at Friday instead.

    I'm sure there is an IF(WEEKDAY(TODAY().... bit that can go in to do this, but I'm simply not clever enough to write it!!

    Many thanks again

+ 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.2.0