Counting not-coloured cells that fall in-between highlighted cells in a column

Gracemusa

New Member
Joined
Jun 16, 2023
Messages
1
Office Version
  1. 2013
  2. 2007
Platform
  1. Windows
Please help. what formula or function can i use for excel to count for me un-coloured cells that are in between highlighted cells in a column (and return each time it gets to a highlighted cell). i dont need a total sum of those uncoloured cells in the column. I need a subtotal count for each section between highlighted cells as demonstrated in the image uploaded. Thanking you in advance for helping!
 

Attachments

  • Screenshot (1).png
    Screenshot (1).png
    108.4 KB · Views: 11

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.
I'm not aware of any formula or function (except a UDF) that would achieve what you want. If you're open to a VBA solution, then try this:
VBA Code:
Option Explicit
Sub CountBetween()
    Dim ws As Worksheet, c As Range, i As Long
    Set ws = Worksheets("Sheet1")   '<~~ *** Change sheet name if needed ***
    For Each c In ws.Range("C3", ws.Cells(Rows.Count, "C").End(xlUp))
        If c.Interior.ColorIndex = xlNone Then
            i = i + 1
            If c.Offset(1).Interior.ColorIndex <> xlNone Then
                c.Offset(0, 2).Value2 = i
                i = 0
            End If
        End If
    Next c
End Sub
 
Upvote 0

Forum statistics

Threads
1,215,217
Messages
6,123,670
Members
449,115
Latest member
punka6

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