This can be done with the SUMPRODUCT function together with the ISODD function.
Instead of ISODD, the MOD function can also be used.
Both approaches are explained below.
SUMPRODUCT with ISODD
The SUMPRODUCT function works directly with arrays.
ISODD is one of these functions.
The + operator is an easy way to make ISODD return all results.
We therefore test for 1.
ISODD will return the #VALUE error if a value is not numeric.
MOD Function
The Excel MOD function returns the remainder of two numbers after division.
For example, MOD(10,3) = 1.
The result of MOD carries the same sign as the divisor.
ISEVEN will return the #VALUE error if a value is not numeric.