Hi.
Firstly, I have tried a search to no avail, but I am not even sure if I am using the right terms to be honest.
I have an excel spreadsheet, it is actually a roster. Shift times are variable but each day three cells will be coloured differently (so one purple, one blue, one green) and the others all white.
I am looking for a formula that will display the person in colour x for that day.
I have had some success making a function for background colour from the internet, and I can use the IF function for up to 8 of the 10 columns but it then hits the length limit. (Excel 2010) It also seems very unwieldy and would be hard to change easily. I am sure there is a better way of doing this, or by making a VBA function.
My spreadsheet is Columns for person and rows for each day of the week, so below is what I have so far (the person's name is on Row 5):
=IF(CellColour(18,4)=39,(D5),IF(CellColour(18,5)=39,(E5),IF(CellColour(18,6)=39,(F5),IF(CellColour(18,7)=39,(G5)))))
The VBA function (from a website) is
Function CellColour(Irow As Integer, Icol As Integer) As Long
CellColour = Cells(Irow, Icol).Interior.ColorIndex
End Function
Is anyone able to offer any help please?
Thanks,
Jon
Bookmarks