Is there a logical test for a cell's format instead of contents

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Microsoft Excel 2003
I have a list of names for a roster in a single column covering several
months. The information is imported from another source (MS Access) which is
maintained by someone else and the only distinction between status (i.e.
rostered, available, unavailable, absent) is the cell format (i.e. colour).
I want to use an IF_statement to identify the different statuses so that I
can produce a summary report.
e.g. I could enter this formula (if there a logical test for a cell's format
instead of contents) in cell B5:
IF(A5 cell colour is blue,"Rostered",IF(A5 cell colour is
green,"Available",IF(A5cell colour is grey,"unavailable","absent")))
I could then use a lookup function to create my summary report.
 
You could insert a very tiny UDF that returns the cells' background color:

Function clr(R As Range) As Integer
With R.Interior
clr = .ColorIndex
End With
End Function

So that if the background color of A1 is red, then =clr(A1) would return 3
______________________________________
Gary's Student
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top