Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Is there a function like substring in excel or something similar like that.
I would like to add all the digits in a cell to a single value, how would I do that? Thank you very much, huong |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
click the cell and type an equal sign then a number then a plus sign, like so
=5+5+4+3 cell should equal 17 -- Cheers, Ryan "huong" wrote: Is there a function like substring in excel or something similar like that. I would like to add all the digits in a cell to a single value, how would I do that? Thank you very much, huong |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
huong wrote:
Is there a function like substring in excel or something similar like that. I would like to add all the digits in a cell to a single value, how would I do that? Thank you very much, Hello huong, There is a MID function (see F1), but you would have to write two stand-alone MIDs (or more, depending on the length of your input) to accomplish what you want. The following works for any reasonable length of input. It is an array formula, so you must press Ctrl+Shift+Enter to commit: =SUM(VALUE(MID(A1,ROW(INDIRECT("x1:x"&LEN(A1))),1) )) (Idea stolen from Pete_UK -- all props to him!) |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
=SUMPRODUCT(--MID($A$1,ROW(INDIRECT("1:" & LEN($A$1))),1))
37 returns 10 123 returns 6 Gord Dibben MS Excel MVP On Wed, 3 Sep 2008 16:12:09 -0700, huong wrote: Is there a function like substring in excel or something similar like that. I would like to add all the digits in a cell to a single value, how would I do that? Thank you very much, huong |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Try this array-entered** formula...
=SUM(IF(ROW(1:99)<=LEN(A1),--MID(A1,ROW(1:99),1),"")) ** Commit this formula with Ctrl+Shift+Enter, not just Enter by itself. Note: If you enter your digits as text, the above formula will add up to the first 99 digits. If you would want more than that, just change both 99's to the same higher digit limit. -- Rick (MVP - Excel) "huong" wrote in message ... Is there a function like substring in excel or something similar like that. I would like to add all the digits in a cell to a single value, how would I do that? Thank you very much, huong |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Is there any way of calculating a running total within a single cell in a column | New Users to Excel | |||
keeping a running total in a single cell | Excel Worksheet Functions | |||
Adding a Single Cell total from Seperate sheets | Excel Worksheet Functions | |||
how do i set up a single cell continual entry in excel to total f. | Excel Discussion (Misc queries) | |||
how do i calculate a running total in a single cell in excel | Excel Programming |