Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 310
Default More Functions based on Font Color

I'm trying to add the cells who's font color is red. What I have so far is

=SUMIF(F4:F116," ")

Am I close?
  #2   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 2,420
Default More Functions based on Font Color

No. You need a UDF as well as a formula

Add this function

Function CellColours(rng As Range) As Variant
Dim ary As Variant
Dim cell As Range
Dim i As Long

ReDim ary(1 To rng.Rows.Count)
i = 1
For Each cell In rng

ary(i) = cell.Font.ColorIndex
i = i + 1
Next cell
CellColours = ary
End Function

and then sum like this to sum all red font cells

=SUMPRODUCT(--(CellColours(A1:A10)=3) ,A1:A10)

and simply count all green font cells like

=SUMPRODUCT(--(CellColours(A1:A10)=10))


--
__________________________________
HTH

Bob

"michelle" wrote in message
...
I'm trying to add the cells who's font color is red. What I have so far is

=SUMIF(F4:F116," ")

Am I close?



  #3   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 22,906
Default More Functions based on Font Color

How did the font color get to be red?

If by Conditional formatting, Excel won't pick up the colorindex of the
font.

See Chip Pearson's site if that is the case.

http://www.cpearson.com/excel/CFColors.htm


Gord Dibben MS Excel MVP

On Tue, 2 Sep 2008 23:15:01 -0700, michelle
wrote:

I'm trying to add the cells who's font color is red. What I have so far is

=SUMIF(F4:F116," ")

Am I close?


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
Adding codes based on a font color Ing Excel Discussion (Misc queries) 1 June 9th 08 09:25 AM
Changing Font color based on font type or size John Excel Discussion (Misc queries) 2 February 7th 08 12:50 AM
change font color based on a value Golf Nut[_2_] Excel Worksheet Functions 1 April 26th 07 03:30 PM
How to sum data based on font or cell color? techiesol Excel Worksheet Functions 6 May 24th 06 04:11 PM
I can't figure out how to add values based on font color. Laura Excel Discussion (Misc queries) 1 February 28th 06 04:28 PM


All times are GMT +1. The time now is 05:39 AM.

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

About Us

"It's about Microsoft Excel"