How to Add in Excel?
Open Excel Workbook and follow the steps mentioned below.- Select Range of Cells that you want Sum in Excel sheet & Click βAutoSumβ in Home Menu Right hand side end.
- Type β=1+2β in Excel Sheet and hit Enter. It will answer as 3
- Type β=Sum(1,2,3)β , press Enter to get result 6
- Type in Cell A1 β=B1+B2+B3β, it will add the numbers in cells B1,B2,B3
- Type in Cell A1 β=SUM(B1,B2,B3)β, it will add the numbers in cells B1,B2,B3
- Add Numbers Using Reference to another Worksheet: Type in Sheet1 Cell A1 β=Sheet2!A1+Sheet2!A2+Sheet2!A3β
How to Add Numbers in Excel Macro VBA Code
To add numbers in Excel VBA macro, the operator β+β has to be used directly.Sub Add_Numbers_In_Excel()
'Declare variables used in program
Dim i As Integer, j As Integer, k As Integer
'Get a value from Excel Sheet
i = VBA.Val(ThisWorkbook.Sheets(1).Cells(1, 1))
j = 2
'Add Numbers and display result
k = i + j
MsgBox "Addition of Numbers Result is: " & k
End Sub
This sample will just work well. But in case if there are lot of numbers that you want to sum, then fetch the numbers from worksheet and add them inside a loop.
Advanced Functions used to Add Numbers
- SUMIF(Range, Criteria) β Total the Numbers in Range based on a criteria
- SUMIFS(Sum Range, Criteria Range, Criteria)
- SUMPRODUCT
- SUMSQ β Total the square of the numbers in the argument