Calc: calculate number of cells containing digits, rather than actual digits within each cell, in Calc?

Mac OS Mojave, LO

Let’s say I have a spreadsheet containing 4 cells, in each cell is a number, let’s say 1,2,3 & 4 for each respective cell.
How do I calculate the sum of the number of cells with numbers in them (4), rather than the total of the numbers within the cells, to return the result 4, instead of 10 (as a regular SUM formula would produce)?


assuming your numbers are in A1:A4 use: =SUMPRODUCT(ISNUMBER(A1:A4)) or {=SUM(ISNUMBER(A1:A4)) (edit without curly brackets and enter using CTRL+SHIFT+ENTER)

Tested on LibreOffice

Version:,Build ID: 98b30e735bda24bc04ab42594c85f7fd8be07b9c
CPU threads: 8; OS: Linux 4.12; UI render: default; VCL: kde5; 
Locale: en-US (en_US.UTF-8); UI-Language: en-US, Calc: threaded

Hope that helps.

The former produced the desired result. Many thanks indeed!