ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Formula to count Cell colour. (https://www.excelbanter.com/excel-discussion-misc-queries/28331-formula-count-cell-colour.html)

themax16

Formula to count Cell colour.
 

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


--
themax16
------------------------------------------------------------------------
themax16's Profile: http://www.excelforum.com/member.php...o&userid=23622
View this thread: http://www.excelforum.com/showthread...hreadid=374893


Piranha


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

Hi,
See if you can find an answer here.

http://www.xldynamic.com/source/xld.ColourCounter.html

Dave


--
Piranha
------------------------------------------------------------------------
Piranha's Profile: http://www.excelforum.com/member.php...o&userid=20435
View this thread: http://www.excelforum.com/showthread...hreadid=374893


themax16


Thanks for that.. one final thing... how do you enter UDF?
thanks
James


--
themax16
------------------------------------------------------------------------
themax16's Profile: http://www.excelforum.com/member.php...o&userid=23622
View this thread: http://www.excelforum.com/showthread...hreadid=374893


Naz

You go into VBA ToolsMacrosVisual 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)

--

_______________________
Naz,
London


"themax16" wrote:


Thanks for that.. one final thing... how do you enter UDF?
thanks
James


--
themax16
------------------------------------------------------------------------
themax16's Profile: http://www.excelforum.com/member.php...o&userid=23622
View this thread: http://www.excelforum.com/showthread...hreadid=374893




All times are GMT +1. The time now is 12:59 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com