Count cell by fill color and text color #excel #exceltutorial

Published: 05 May 2023
on channel: Boost Excel
3k
22

Here is a video tutorial on how to count cell by fill color and text color

Subscribe to Excel Art


Code for COUNTFONTCOLOR Formula
Function COUNTFONTCOLOR(cell_range As Range, CellFont_color As Range) As Long
Dim FontColor As Long
Dim CurrentRange As Range
Dim FontRes As Long
Application.Volatile
FontRes = 0
FontColor = CellFont_color.Cells(1, 1).Font.Color
For Each CurrentRange In cell_range
If FontColor = CurrentRange.Font.Color Then
FontRes = FontRes + 1
End If
Next CurrentRange
COUNTFONTCOLOR = FontRes
End Function

Code for COUNTCOLOR Formula
Function COUNTCOLOR(CellRange As Range, CellColor As Range)
Dim FillColor As Integer
Dim FillTotal As Integer
FillColor = CellColor.Interior.ColorIndex
Set rCell = CellRange
For Each rCell In CellRange
If rCell.Interior.ColorIndex = FillColor Then
FillTotal = FillTotal + 1
End If
Next rCell
COUNTCOLOR = FillTotal
End Function

for beginner


Watch video Count cell by fill color and text color #excel #exceltutorial online without registration, duration 02 minute 22 second in high hd quality. This video was added by user Boost Excel 05 May 2023, don't forget to share it with your friends and acquaintances, it has been viewed on our site 3 thousand once and liked it 22 people.