+ Reply to Thread
Results 1 to 3 of 3

COUNTIF Cell Highlighted (Excel 2003)

Hybrid View

vooshy COUNTIF Cell Highlighted... 12-18-2014, 05:50 PM
ELeGault Re: COUNTIF Cell Highlighted... 12-18-2014, 05:56 PM
vooshy Re: COUNTIF Cell Highlighted... 12-18-2014, 06:00 PM
  1. #1
    Registered User
    Join Date
    03-20-2009
    Location
    Norwich, England
    MS-Off Ver
    Excel 2003
    Posts
    5

    Question COUNTIF Cell Highlighted (Excel 2003)

    Hi,

    I'm looking for a formula to count if the cell is highlighted.
    Unfortunately my excel formula skills are slightly lacking.

    i.e.

    a1 = highlighted red
    a2 = highlighted yellow
    a3 = highlighted green
    a4 = highlighted red
    a5 = formula to count red

    Regards,
    Vooshy

  2. #2
    Valued Forum Contributor
    Join Date
    11-22-2014
    Location
    Arizona, USA
    MS-Off Ver
    Office 365
    Posts
    973

    Re: COUNTIF Cell Highlighted (Excel 2003)

    Its not an ability of excel by default you will need to add functions to have this capability and I am not sure that 03' will handle it...

    You will need to add this in VBA

    Function CountCellsByColor(rData As Range, cellRefColor As Range) As Long
        Dim indRefColor As Long
        Dim cellCurrent As Range
        Dim cntRes As Long
         Application.Volatile
        cntRes = 0
        indRefColor = cellRefColor.Cells(1, 1).Interior.Color
        For Each cellCurrent In rData
            If indRefColor = cellCurrent.Interior.Color Then
                cntRes = cntRes + 1
            End If
        Next cellCurrent
         CountCellsByColor = cntRes
         End Function
    and then you will be able to type
    in cell B1
    =CountCellsByColor(RANGE,A1)
    and that will count all that are the same color as A1 so make A1 Red as well
    -If you think you are done, Start over - ELeGault

  3. #3
    Registered User
    Join Date
    03-20-2009
    Location
    Norwich, England
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: COUNTIF Cell Highlighted (Excel 2003)

    Many thanks, works a charm

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Using COUNTIF for Excel 2003
    By martm10 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-20-2014, 05:50 AM
  2. COUNTIF Bug in Excel 2003
    By Mangesh Yadav in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 09-06-2005, 11:05 AM
  3. [SOLVED] COUNTIF Bug in Excel 2003
    By byundt in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 10:05 AM
  4. [SOLVED] COUNTIF Bug in Excel 2003
    By byundt in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 02:05 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1