Formula to count Cell colour.

T

themax16

Morning all,
I am looking to set up a formula to count cells IF they are a fille
with a specific colour. Is this possible as i cannot find any way t
ask to countif - eg green.
I have tried everything i could think of - =COUNTIF(C5:BI24,(GREEN))
Any help will be greatly appreciated.
Jame
 
N

Naz

You go into VBA Tools>Macros>Visual Basic Editor
In a module instead of Sub() and End Sub which you normally use you type

Function NameOfFunction(enter here seperated by commas, any cells the
function will use)

NameOfFunction= expression

End function

E.g say you wanted to calculate tax you could write this unction

Function Tax(Cell1,Cell2)

Tax = Cell1 * Cell2

End Function

The in the spreadsheet your formula would be

=Tax(cell you want to calculate tax for, cell with the tax rate )
so if the value cell was A1 (100) and B1 (10%) had the tax rate

=Tax(A1,B1)

gives

10 (100*.1)
 
Top