Site icon TheBigBrains

How To Sum All Numbers In A Cell in Excel

How To Sum All Numbers In A Cell in Excel

We will see in this post one of the easiest ways, to sum up, all the digits in a number in excel.

Let’s see how we can get the sum of digits in a cell in excel.

We will see a simple formula to find out the sum of all the digits in a number in excel e.g. 11112=1+1+1+1+2=6.

You can do this using two method

  1. Using Formula
  2. Using Macro Custom Function

Read: How To Remove Protected View In Excel

How To Sum All Numbers In A Cell in Excel

Using Formula

Using bellow formula you can easily sum cell numbers

 =IF(COUNT(A8),SUMPRODUCT(--MID(A8,ROW(INDIRECT("1:"&LEN(A8))),1)),0)

Using Macro Custom Function

Public Function SumCellValue(number1 As Double)

CellValue = number1
CountCellValue = Len(CellValue)

CellVT = 0

For RowValue = 1 To CountCellValue
    Char = Mid(CellValue, RowValue, 1)
    CellVT = CellVT + Char
    SumCellValue = CellVT
Next RowValue

End Function

If you like this function so kindly share your feedback in bellow comment box.

Exit mobile version