View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Lotus123
 
Posts: n/a
Default adding digits of a number


wish I knew arrays better :)

David Billigmeier Wrote:
Assume cell A1, need to enter these formulas with CTRL+SHIFT+ENTER as
they
are array formulas:

To add the odd numbers:
=SUMPRODUCT(IF(MOD(ROW(INDIRECT("1:"&LEN(A1))),2)= 1,--MID(A1,ROW(INDIRECT("1:"&LEN(A1))),1),0))

To add the even numbers:
=SUMPRODUCT(IF(MOD(ROW(INDIRECT("1:"&LEN(A1))),2)= 0,--MID(A1,ROW(INDIRECT("1:"&LEN(A1))),1),0))
--
Regards,
Dave



--
Lotus123
------------------------------------------------------------------------
Lotus123's Profile: http://www.excelforum.com/member.php...o&userid=28611
View this thread: http://www.excelforum.com/showthread...hreadid=527838