count occurences of a phrase, taking into account cell colour ?

pudle

New Member
Joined
Jul 19, 2012
Messages
8
hi,

im having a little trouble trying to write a formula to count the occurrences of a phrase in the range B:B, but i want to count the phrases separately depending on there cells fill colour..

ie. if the cells fill colour is red it would be counted and added to the f1 cell, if blue f2, if fill green f3

to count the phrases i was planning to use
Code:
=COUNTIF(B:B, "sam")
but this dosnt take into acount the cells colour, and i would also like to take into account variants of the phrase such as " sam" or "sam,"

is this possible using formulas or could it be writen as a macro ?
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
hi,

im having a little trouble trying to write a formula to count the occurrences of a phrase in the range B:B, but i want to count the phrases separately depending on there cells fill colour..

ie. if the cells fill colour is red it would be counted and added to the f1 cell, if blue f2, if fill green f3

to count the phrases i was planning to use
Code:
=COUNTIF(B:B, "sam")
but this dosnt take into acount the cells colour, and i would also like to take into account variants of the phrase such as " sam" or "sam,"

is this possible using formulas or could it be writen as a macro ?
You will need to use a VBA function to do this unless we can use the logic as to why a cell is a certain color. Are the cells colored using conditional formatting? If so, what are the rules used to color the cells?
 
Upvote 0
the cells are colored originally using a macro thats run on other sheets much earlier in the process, all this data is then pulled in a results workbook which i were i want to count the phrases
 
Upvote 0

Forum statistics

Threads
1,215,020
Messages
6,122,709
Members
449,093
Latest member
Mnur

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top