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


Several ways to approach this...depending on how complex the data series
is. I'll assume the data series is uniform for this example...aka,
every number you want to use this one will have 6 digits. Number is in
cell A1..formula in A2.

=VALUE(MID(A1,1,1))+VALUE(MID(A1,2,1))+VALUE(MID(A 1,3,1))+VALUE(MID(A1,4,1))+VALUE(MID(A1,5,1))+VALU E(MID(A1,6,1))

This formula could be expanded for a larger number by adding to the
end. If you attempt to use this formula on a number smaller than 6
digits you will get an error...which gets into uniformity. If your
data is different, you can also add a check on each MID to see the
value is there, ISERROR()...if it is an error, don't add it.


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