#1   Report Post  
Jo Davis
 
Posts: n/a
Default Count If formula

Hi

Can you use the count if formula to say:

count how many cells say "sold" in blue text and how many say it in green
text?

  #2   Report Post  
Bob Phillips
 
Posts: n/a
Default

You need a function to coun t the colour, like the one at
http://www.xldynamic.com/source/xld.ColourCounter.html

and then combine this with the text test like so,

=SUMPRODUCT(--(A1:A100="sold"),--(ColorIndex(A1:A100)=3))

to test for red solds.


--
HTH

Bob Phillips

"Jo Davis" wrote in message
...
Hi

Can you use the count if formula to say:

count how many cells say "sold" in blue text and how many say it in green
text?



  #3   Report Post  
Jo Davis
 
Posts: n/a
Default

Thanks Bob, thats great, how do you know what the numbers are for each colour

"Bob Phillips" wrote:

You need a function to coun t the colour, like the one at
http://www.xldynamic.com/source/xld.ColourCounter.html

and then combine this with the text test like so,

=SUMPRODUCT(--(A1:A100="sold"),--(ColorIndex(A1:A100)=3))

to test for red solds.


--
HTH

Bob Phillips

"Jo Davis" wrote in message
...
Hi

Can you use the count if formula to say:

count how many cells say "sold" in blue text and how many say it in green
text?




  #4   Report Post  
Duke Carey
 
Posts: n/a
Default

To get the Color Index for the cells you want to count:

1) Select a cell with blue text
2) Press Alt-F11 to open the VBE
3) press Ctrl-G to open the Immediate Window
4) type in - ?Activecell.Font.ColorIndex
5) press the Enter key

at that point Excel will report the color index of that font. Repeat the
process for your green-colored font.

"Jo Davis" wrote:

Thanks Bob, thats great, how do you know what the numbers are for each colour

"Bob Phillips" wrote:

You need a function to coun t the colour, like the one at
http://www.xldynamic.com/source/xld.ColourCounter.html

and then combine this with the text test like so,

=SUMPRODUCT(--(A1:A100="sold"),--(ColorIndex(A1:A100)=3))

to test for red solds.


--
HTH

Bob Phillips

"Jo Davis" wrote in message
...
Hi

Can you use the count if formula to say:

count how many cells say "sold" in blue text and how many say it in green
text?




  #5   Report Post  
Bob Phillips
 
Posts: n/a
Default

That is the tricky bit Jo. In a normal workbook, you can look up the values
in the help or run this bit of code to list them on a worksheet

Dim i As Long
For i = 1 To 56
Cells(i, "A") = i
Cells(i, "B").Interior.ColorIndex = i
Next i

Remember that these colours do not have a name within Excel, as they are
configurable. AN other way is to put the colour that you want to test in a
cell, say H1, and use that in the formula

=SUMPRODUCT(--(A1:A100="sold"),--(ColorIndex(A1:A100)=H1))

--
HTH

Bob Phillips

"Jo Davis" wrote in message
...
Thanks Bob, thats great, how do you know what the numbers are for each

colour

"Bob Phillips" wrote:

You need a function to coun t the colour, like the one at
http://www.xldynamic.com/source/xld.ColourCounter.html

and then combine this with the text test like so,

=SUMPRODUCT(--(A1:A100="sold"),--(ColorIndex(A1:A100)=3))

to test for red solds.


--
HTH

Bob Phillips

"Jo Davis" wrote in message
...
Hi

Can you use the count if formula to say:

count how many cells say "sold" in blue text and how many say it in

green
text?








  #6   Report Post  
Jo Davis
 
Posts: n/a
Default

Thats great Thanks for your help guys!

"Bob Phillips" wrote:

That is the tricky bit Jo. In a normal workbook, you can look up the values
in the help or run this bit of code to list them on a worksheet

Dim i As Long
For i = 1 To 56
Cells(i, "A") = i
Cells(i, "B").Interior.ColorIndex = i
Next i

Remember that these colours do not have a name within Excel, as they are
configurable. AN other way is to put the colour that you want to test in a
cell, say H1, and use that in the formula

=SUMPRODUCT(--(A1:A100="sold"),--(ColorIndex(A1:A100)=H1))

--
HTH

Bob Phillips

"Jo Davis" wrote in message
...
Thanks Bob, thats great, how do you know what the numbers are for each

colour

"Bob Phillips" wrote:

You need a function to coun t the colour, like the one at
http://www.xldynamic.com/source/xld.ColourCounter.html

and then combine this with the text test like so,

=SUMPRODUCT(--(A1:A100="sold"),--(ColorIndex(A1:A100)=3))

to test for red solds.


--
HTH

Bob Phillips

"Jo Davis" wrote in message
...
Hi

Can you use the count if formula to say:

count how many cells say "sold" in blue text and how many say it in

green
text?







  #7   Report Post  
Don Guillett
 
Posts: n/a
Default

Make your own

Sub makecolortable()
For i = 1 To 56
Cells(i, 1) = i
Cells(i, 2).Interior.ColorIndex = i
Next i
End Sub
--
Don Guillett
SalesAid Software


"Jo Davis" wrote in message
...
Thanks Bob, thats great, how do you know what the numbers are for each

colour

"Bob Phillips" wrote:

You need a function to coun t the colour, like the one at
http://www.xldynamic.com/source/xld.ColourCounter.html

and then combine this with the text test like so,

=SUMPRODUCT(--(A1:A100="sold"),--(ColorIndex(A1:A100)=3))

to test for red solds.


--
HTH

Bob Phillips

"Jo Davis" wrote in message
...
Hi

Can you use the count if formula to say:

count how many cells say "sold" in blue text and how many say it in

green
text?






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
Creating a check mark box MarthaSue Setting up and Configuration of Excel 18 April 28th 05 12:31 AM
Named SUM Formula with relative refernce(s) Werner Rohrmoser Excel Worksheet Functions 2 April 20th 05 04:56 PM
Formula to count number of dates in an array Lilasviolet Excel Worksheet Functions 2 April 7th 05 07:44 PM
Count numbers formed from another formula Stephen Excel Discussion (Misc queries) 4 April 5th 05 02:30 AM
Conversion SVC Excel Worksheet Functions 9 February 28th 05 02:29 PM


All times are GMT +1. The time now is 06:30 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"