Question

I'm creating a schedule in Excel that is supposed to tell me if something is wrong, explained simply. I'm stuck on a function. I'm using conditional formatting to color cells that are incorrect in some way. Hopefully I'll be able to explain this so that I understand. The schedule is built with dates on the Y-axis and different tasks on the X-axis (I've attached an example for you), I fill each cell with a name for each task and date. One of the tasks is for a team, but I only enter the team leader's name in the cell. The thing is that the team members might have another task that day, and I want to be warned if that happens. Look at the example file. In the first sheet you see the schedule, with three different tasks. In the second sheet you see the teams. I want to create a conditional formatting-formula for column C and D that checks if the team members are already occupied. I've made the names that the conditional formatting should format italic.

I've made some formulas that work:

=AND((C2<>"");($B2=Teams!$A$1);C2=(VLOOKUP(C2;Teams!$A$2:$A$10;1;FALSE)))

=AND((C2<>"");($B2=Teams!$B$1);C2=(VLOOKUP(C2;Teams!$B$2:$B$10;1;FALSE)))

=AND((C2<>"");($B2=Teams!$C$1);C2=(VLOOKUP(C2;Teams!$C$2:$C$10;1;FALSE)))

So if the cell is not empty and if the first team leader is assigned to the task "Team task" it goes through the first team leader's team and if it finds the person currently written in the task cell it fires the conditional formatting.

The thing is that I want it to work automatically if I add another team, with the formulas above I would have to create another one for each team I add.

The example: link to file on Dropbox

Do you understand what I'm after?

One thing I've written a function that could have worked but it doesn't, I think it is the following

 VLOOKUP(F2;ADDRESS[stuff that's working]:ADDRESS[stuff that's working];1;FALSE)

Isn't it possible to use ADDRESS-functions inside the VLOOKUP?

Solution as suggested by user2799312 (a little modified by me) =AND(C1<>"";OR(C1=INDEX(Team!$A$1:$E$20; ;MATCH($B1;Team!$1:$1;0)))) I've included row 1 to be able to apply the rule to the entire columns (C & D), and the AND-statement to exclude empty cells.

Thanks,

Oskar

Was it helpful?

Solution

{=OR(C2=INDEX(Teams!$A$1:$C$3, ,MATCH($B2,Teams!$1:$1,0)))}

Take a look at this one. You can ignore the curly brackets as Conditional Formatting treats all formulas as arrays. Hope this helps.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top