How to Add Odd Numbers in Microsoft Excel 2007

microsoft excelmicrosoft-excel-2007

I'm trying to add only "odd" numbers from a range(named "data") which contains numbers, blank cells and text. No matter what I try I always seem to end up with a #value error. My latest attempt is as follows:
=SUMPRODUCT(N(MOD(Data,2)=1),Data)
Any suggestions?

Best Answer

Use Array Formula

=SUM(IF(ISNUMBER(data), IF(MOD(data, 2) = 1, data, 0), 0))

Press Ctrl+Shift+Enter after entering the formula

(Tested in Excel 2003)

Related Question