Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
How to determine the number?
Does anyone have any suggestions on how to determine the number?
For example, 2584 in cell A1, then it should return 2+5+8+4=19 in cell B1. Does anyone have any suggestions? Thanks in advance for any suggestions Eric |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
How to determine the number?
Try this
Sub addupnumberdigits() ac = ActiveCell mysum = 0 For i = 1 To Len(ac) mysum = mysum + Mid(ac, i, 1) Next i MsgBox mysum End Sub -- Don Guillett Microsoft MVP Excel SalesAid Software "Eric" wrote in message ... Does anyone have any suggestions on how to determine the number? For example, 2584 in cell A1, then it should return 2+5+8+4=19 in cell B1. Does anyone have any suggestions? Thanks in advance for any suggestions Eric |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
How to determine the number?
=LEFT(A1,1)+RIGHT(A1,1)+MID(A1,2,1)+MID(A1,3,1)
-- Gary''s Student - gsnu200802 |
#4
Posted to microsoft.public.excel.misc
|
|||
|
|||
How to determine the number?
Thank everyone for any suggestions
Could you please tell me how to apply following codes? Thanks you very much for any suggestions Eric "Don Guillett" wrote: Try this Sub addupnumberdigits() ac = ActiveCell mysum = 0 For i = 1 To Len(ac) mysum = mysum + Mid(ac, i, 1) Next i MsgBox mysum End Sub -- Don Guillett Microsoft MVP Excel SalesAid Software "Eric" wrote in message ... Does anyone have any suggestions on how to determine the number? For example, 2584 in cell A1, then it should return 2+5+8+4=19 in cell B1. Does anyone have any suggestions? Thanks in advance for any suggestions Eric |
#5
Posted to microsoft.public.excel.misc
|
|||
|
|||
How to determine the number?
Here is a non-vba, non character length specific possibility. Assuming your
value is in cell A1: =SUMPRODUCT(--(MID(A1,ROW(INDIRECT("1:"&LEN(A1))),1))) Hope this helps. -- John C "Eric" wrote: Does anyone have any suggestions on how to determine the number? For example, 2584 in cell A1, then it should return 2+5+8+4=19 in cell B1. Does anyone have any suggestions? Thanks in advance for any suggestions Eric |
#6
Posted to microsoft.public.excel.misc
|
|||
|
|||
How to determine the number?
Nice
-- Don Guillett Microsoft MVP Excel SalesAid Software "John C" <johnc@stateofdenial wrote in message ... Here is a non-vba, non character length specific possibility. Assuming your value is in cell A1: =SUMPRODUCT(--(MID(A1,ROW(INDIRECT("1:"&LEN(A1))),1))) Hope this helps. -- John C "Eric" wrote: Does anyone have any suggestions on how to determine the number? For example, 2584 in cell A1, then it should return 2+5+8+4=19 in cell B1. Does anyone have any suggestions? Thanks in advance for any suggestions Eric |
#7
Posted to microsoft.public.excel.misc
|
|||
|
|||
How to determine the number?
Hi Eric
try =SUMPRODUCT(--MID(A1,ROW(INDIRECT("$1:$"&LEN(A1))),1)) -- Regards Roger Govier "Eric" wrote in message ... Does anyone have any suggestions on how to determine the number? For example, 2584 in cell A1, then it should return 2+5+8+4=19 in cell B1. Does anyone have any suggestions? Thanks in advance for any suggestions Eric |
#8
Posted to microsoft.public.excel.misc
|
|||
|
|||
How to determine the number?
The absolute references in the INDIRECT statement are unnecessary. :)
-- John C "Roger Govier" wrote: Hi Eric try =SUMPRODUCT(--MID(A1,ROW(INDIRECT("$1:$"&LEN(A1))),1)) -- Regards Roger Govier "Eric" wrote in message ... Does anyone have any suggestions on how to determine the number? For example, 2584 in cell A1, then it should return 2+5+8+4=19 in cell B1. Does anyone have any suggestions? Thanks in advance for any suggestions Eric |
#9
Posted to microsoft.public.excel.misc
|
|||
|
|||
How to determine the number?
Absolutely True
Comes out of habit (and does not cause a problem(bg) -- Regards Roger Govier "John C" <johnc@stateofdenial wrote in message ... The absolute references in the INDIRECT statement are unnecessary. :) -- John C "Roger Govier" wrote: Hi Eric try =SUMPRODUCT(--MID(A1,ROW(INDIRECT("$1:$"&LEN(A1))),1)) -- Regards Roger Govier "Eric" wrote in message ... Does anyone have any suggestions on how to determine the number? For example, 2584 in cell A1, then it should return 2+5+8+4=19 in cell B1. Does anyone have any suggestions? Thanks in advance for any suggestions Eric |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How to determine the number of types? | Excel Discussion (Misc queries) | |||
Determine Row number | Excel Discussion (Misc queries) | |||
How to determine the cell contain number only? | Excel Discussion (Misc queries) | |||
How to determine the number in excel? | Excel Discussion (Misc queries) | |||
Determine number of days | Excel Worksheet Functions |