If you mean by "highlighted" selected, then note the lower right side of the
status bar when you have some values selected - it will say SUM = 1234.
Right-click where you see the SUM and change the option to COUNT or COUNT
NUMS.
If you mean by "highlighed" that the cells have a fill color applied, then
you need either a VBA Function or VBA Sub, both will work.