I have a table of data and from it I can calculate two things SEPERATELY:
1. Count different formatting colours as applied to the cells in the table - this I achieved by getting some custom code (see below) and placing this in a module of the workbook, and then using the formula ColorFunction($ATO$6,$B34:$ATE34) to count total cells contianing a specific color:
Function ColorFunction(rColor As Range, rRange As Range, Optional SUM As Boolean)<?xml:namespace prefix = o ns = "urn:schemas-microsoft-comfficeffice" /><o></o>
<o> </o>
Dim rCell As Range<o></o>
<o> </o>
Dim lCol As Long<o></o>
<o> </o>
Dim vResult<o></o>
<o> </o><o> </o><o> </o>
''''''''''''''''''''''''''''''''''''''<o></o>
<o> </o>
'Written by Ozgrid Business Applications<o></o>
<o> </o>
'www.ozgrid.com<o></o>
1. Counts cells which contain a specific string of text using the formula: COUNTIF($B34:$ATE34,"*"&$ATU$3&"*"),"")
Now I want to combine these two functions together and count (from the same table) the number of cells which meet BOTH criteria, e.g. where the cell color is (e.g.) Yellow AND where the text string contains "ABC". Is this possible, and how will I achieve that? Thanks!
1. Count different formatting colours as applied to the cells in the table - this I achieved by getting some custom code (see below) and placing this in a module of the workbook, and then using the formula ColorFunction($ATO$6,$B34:$ATE34) to count total cells contianing a specific color:
Function ColorFunction(rColor As Range, rRange As Range, Optional SUM As Boolean)<?xml:namespace prefix = o ns = "urn:schemas-microsoft-comfficeffice" /><o></o>
<o> </o>
Dim rCell As Range<o></o>
<o> </o>
Dim lCol As Long<o></o>
<o> </o>
Dim vResult<o></o>
<o> </o><o> </o><o> </o>
''''''''''''''''''''''''''''''''''''''<o></o>
<o> </o>
'Written by Ozgrid Business Applications<o></o>
<o> </o>
'www.ozgrid.com<o></o>
1. Counts cells which contain a specific string of text using the formula: COUNTIF($B34:$ATE34,"*"&$ATU$3&"*"),"")
Now I want to combine these two functions together and count (from the same table) the number of cells which meet BOTH criteria, e.g. where the cell color is (e.g.) Yellow AND where the text string contains "ABC". Is this possible, and how will I achieve that? Thanks!