Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 7
Default percentage of green cells in list

Hi
i have a list of dates coloured either red or green in column A and i
want to express the green cells as a percentage of the total list ie
12/02/10
14/02/10
20/0210 etc
this list is constantly being added to

thanks for any
help

rslc

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,520
Default percentage of green cells in list

There is no built-in excel function to do this. But you can use a UDF that
looks at the range and returns the sum of color. But that function will not
recalculate if you change color. Every time you change the color you will
need to recalculate or wait excel to recalculate...

To install the UDF (User Defined function). From workbook launch VBE using
Alt+F11. From menu Insert a Module and paste the below function.Close and get
back to workbook and try the below formula.

Function COLORCOUNT(varRange As Range, varColor As Range)
Dim cell As Range
For Each cell In varRange
If cell.Interior.ColorIndex = varColor.Interior.ColorIndex Then
ColorCount = ColorCount + 1
End If
Next
End Function

ITo use the as a formula in range A1:A10 try the below; which will count the
number of blue cells....The second argument denotes the colored cell (to be
queried).

=COLORCOUNT(A1:A10,B1)
--
Jacob


"rslc" wrote:

Hi
i have a list of dates coloured either red or green in column A and i
want to express the green cells as a percentage of the total list ie
12/02/10
14/02/10
20/0210 etc
this list is constantly being added to

thanks for any
help

rslc

.

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,520
Default percentage of green cells in list

Forgot to mention that the below do not work for Conditional Formatted cells.

--
Jacob


"Jacob Skaria" wrote:

There is no built-in excel function to do this. But you can use a UDF that
looks at the range and returns the sum of color. But that function will not
recalculate if you change color. Every time you change the color you will
need to recalculate or wait excel to recalculate...

To install the UDF (User Defined function). From workbook launch VBE using
Alt+F11. From menu Insert a Module and paste the below function.Close and get
back to workbook and try the below formula.

Function COLORCOUNT(varRange As Range, varColor As Range)
Dim cell As Range
For Each cell In varRange
If cell.Interior.ColorIndex = varColor.Interior.ColorIndex Then
ColorCount = ColorCount + 1
End If
Next
End Function

ITo use the as a formula in range A1:A10 try the below; which will count the
number of blue cells....The second argument denotes the colored cell (to be
queried).

=COLORCOUNT(A1:A10,B1)
--
Jacob


"rslc" wrote:

Hi
i have a list of dates coloured either red or green in column A and i
want to express the green cells as a percentage of the total list ie
12/02/10
14/02/10
20/0210 etc
this list is constantly being added to

thanks for any
help

rslc

.

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 7
Default percentage of green cells in list

Thanks Jacob
unfortunately my list is conditionally formatted and
i was hoping to use a formula as a conditional format to achieve this

but thanks for the help


rslc

"Jacob Skaria" wrote in message
...
Forgot to mention that the below do not work for Conditional Formatted
cells.

--
Jacob


"Jacob Skaria" wrote:

There is no built-in excel function to do this. But you can use a UDF
that
looks at the range and returns the sum of color. But that function will
not
recalculate if you change color. Every time you change the color you
will
need to recalculate or wait excel to recalculate...

To install the UDF (User Defined function). From workbook launch VBE
using
Alt+F11. From menu Insert a Module and paste the below function.Close and
get
back to workbook and try the below formula.

Function COLORCOUNT(varRange As Range, varColor As Range)
Dim cell As Range
For Each cell In varRange
If cell.Interior.ColorIndex = varColor.Interior.ColorIndex Then
ColorCount = ColorCount + 1
End If
Next
End Function

ITo use the as a formula in range A1:A10 try the below; which will count
the
number of blue cells....The second argument denotes the colored cell (to
be
queried).

=COLORCOUNT(A1:A10,B1)
--
Jacob


"rslc" wrote:

Hi
i have a list of dates coloured either red or green in column A
and i
want to express the green cells as a percentage of the total list ie
12/02/10
14/02/10
20/0210 etc
this list is constantly being added to

thanks for
any
help

rslc

.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
I want cells to show green if <10% and red if10%. please help Charles T. Garrett New Users to Excel 0 August 28th 09 11:43 AM
Green arrow in cells [email protected] Excel Worksheet Functions 3 January 31st 08 10:38 AM
Can i add up all green filled cells in a workbook? Richelle Excel Worksheet Functions 1 November 30th 05 05:40 AM
How do I get excel to add cells by color? Like all green cells (s. chakatania Excel Discussion (Misc queries) 1 March 8th 05 10:25 AM
I am getting Green triangle on one column in all the cells ? nach New Users to Excel 2 December 14th 04 10:03 PM


All times are GMT +1. The time now is 08:07 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"