![]() |
|
|||||||
![]() |
|
I need help with microsoft Excel spreadsheet?
|
![]() |
LinkBack | Thread Tools | ![]() |
Display Modes | ![]() |
|
|||
|
Is it possible to do a count by colour of text? Say for example in 1 column i have green, red and purple text count i count the occurances of each colour?
Is there a way i can return a true or false value from coloured text? i am not using numbers so am struggling |
| Links |
|
|
|
|||
|
No. Rather than using colours, you would be better off adding a new column & populating it with values.
|
|
|||
|
Not sure in Excel itself, but you can certianly write a macro along the line of
cells(1,2).value = Cells(1, 1).Interior.ColorIndex this will give a numberical value of the colour of cell (1,1) so you can go through and find all cells in a range that have that colour |
|
|||
|
The link below has a VBA soution - creating a user defined function...
Function CountColor(rColor As Range, rSumRange As Range) '''''''''''''''''''''''''''''''''''''' 'Written by Ozgrid Business Applications 'www.ozgrid.com 'Counts cells based on a specified fill color. ''''''''''''''''''''''''''''''''''''''' Dim rCell As Range Dim iCol As Integer Dim vResult iCol = rColor.Interior.ColorIndex For Each rCell In rSumRange If rCell.Interior.ColorIndex = iCol Then vResult = vResult + 1 End If Next rCell CountColor = vResult End Function -------------------------------------------------------------------------------- To use these UDF's push Alt+F11 and go Insert>Module and paste in the code. Push Alt+Q and save. The Function will appear under "User Defined" in the Paste Function (Shift+F3). |
![]() |
| Thread Tools | |
| Display Modes | |
|
|