+ Reply to Thread
Results 1 to 1 of 1

Using formulas/conditional formatting to change fill of cell based on two criteria

Hybrid View

  1. #1
    Registered User
    Join Date
    05-09-2013
    Location
    Houston, Texas
    MS-Off Ver
    Excel 2010
    Posts
    1

    Using formulas/conditional formatting to change fill of cell based on two criteria

    Hi all,

    I've been teaching myself Excel because at my job, someone really needs to know it. I work at a library where we use a spreadsheet to keep track of whether our study rooms are occupied or not.
    I've successfully been able to apply conditional formatting to the headings of our study rooms to change color based on whether the room is empty, occupied, and how long it's been occupied.
    I've used 4 different formulas to do that, one for if the room hasn't been used at all that day (I is the "Time In" column, J is "Time Out"):
    =AND(I8:I25=0)
    One for if the room has been used but the patron using it has left:
    =VLOOKUP(1000,I8:J25,2)<>0
    One for if there is a patron using it and they have exceeded their allotted two hours (we don't force them to leave unless someone else comes up and asks for a room):
    =AND(LOOKUP(1000,I8:I25)+A1<NOW(),VLOOKUP(1000,I8:J25,2)=0)
    And one for if they have not yet had their two hours (technically, since it's applied after the previous formula, all I've asked it to do is tell me that there is a recorded "in" time but no "out" time):
    =VLOOKUP(1000,I8:J25,2)=0

    In the third formula, the referenced cell "A1" contains a value of "=TODAY()+TIME(2,0,0)".

    What I am trying to add now is an assortment (because I am fairly sure it is going to take more than one) of formulas that will tell staff at a glance which room to vacate first based on the following criteria:
    The patron has had more than two hours in the room AND
    That patron has been in the room the longest.

    To do this I set up an area off to the side which was supposed to report on the in/out columns for each study room.
    Each room has a corresponding cell (set up in L3:S3) which contains this formula:
    =IF(AND(LOOKUP(1000,I8:I25)+A1<NOW(),VLOOKUP(1000,I8:J25,2)=0),MAX(I8:I25),1)
    And it works, when used in conjunction with the formula "=MIN(L3:S3)=L3" (where L3 is the designated cell reporting on one of 8 study rooms) being applied as conditional formatting.

    The problem is this:
    My formulas in L3:S3 return the dreaded #N/A error when no one has yet used the study room, so the conditional =MIN formulas don't work the way they should.
    I have tried producing an amalgamation of the =ISBLANK function that looks like:
    =IF(ISBLANK(D8:D29),5,IF(AND(LOOKUP(1000,D8:D29)+A1<NOW(),VLOOKUP(1000,D8:E29,2)=0),MAX(D8:D29),1))
    And this still returns errors for me.

    So, suggestions? If there's a way to dynamically paste values from another cell, that would be acceptable because then I could just use "=if(isnumber(p3),p3,5) in the cells below each study room's main formula and apply the =MIN formula to that row instead of L3:S3.
    Or if there's something really easy where I don't have to create multiple rows of data for this, that too would be nice.
    Attached Files Attached Files

+ 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