VBA Arithmetic Operators in Excel
Last Updated :
16 Oct, 2022
Arithmetic Operators are the operators which perform mathematical operation or which perform any operation between two numbers like addition(+), subtraction(-), multiplication(*), division( / ), exponentiation(^), modulus(Mod), Bit-Shift operations. In this article, we will learn about the excel VBA arithmetic operators in detail.
Addition Operator (+)
The Addition operator is used to add numbers. We use the (+)plus operator as a symbol for addition. For example, if we want to add 12 and 14 to get 26, then we will use the (+)plus operator. Declare a variable x, and now, write x = 12 + 14, hence, x stores 26 in it.
Subtraction Operator (-)
The Subtraction operator is used to find the difference between two numbers. We use the (-)minus operator as a symbol for subtraction. For example, if we want to subtract 14 and 12 to get 2, then we will use the (-)minus operator. Declare a variable x, and now, write x = 14 – 12, hence, x stores 2 in it.
Multiplication Operator (*)
The Multiplication operator is used to multiply numbers. We use the (*)asterisk operator as a symbol for multiplication. For example, if we want to multiply 4 and 2 to get 8, then we will use the (*)asterisk operator. Declare a variable x, and now, write x = 4 * 2, hence, x stores 8 in it.
Division Operator (/)
The Division operator is used to divide numbers. We use the (/)forward slash operator as a symbol for division. For example, if we want to divide 40 and 20 to get 2, then we will use the (/)forward slash operator. Declare a variable x, and now, write x = 40 / 20, hence, x stores 2 in it.
Exponentiation Operator (^)
The Exponentiation operator is used to get the power of a number. We use the (^)caret operator as a symbol for exponentiation. For example, if we want to exponent 20 with 2 to get 400, then we will use the (^)caret operator. Declare a variable x, and now, write x = 20 ^ 2, hence, x stores 400 in it.
Modulus Operator (Mod)
The Mod operator is used to find the remainder of two numbers. We can write Mod itself, for finding the mod of two numbers. For example, if we find mod of 94 and 6 we get 4. Declare a variable x, and now, write x = 94 Mod 6, hence, x stores 2 in it.
Bit-Shift Operations
The Bit-Shift operators are (<<) left-shift operator and (>>) right-shift operator. The left-shift operator, shifts bits to the left, a number of times, as mentioned. For example, num << 4, shifts the bits of number num, 4 times. Similarly, the right-shift operator, shifts bits to the right, a number of times, as mentioned. For example, num >> 2, shifts the bits of number num, 2 times.


Similar Reads
Excel VBA Concatenation Operators
VBA in Excel stands for Visual Basic for Applications which is Microsoft's programming language. To optimize the performance and reduce the time in Excel we need Macros and VBA is the tool used in the backend. Concatenation means to join two or more data into a single data. There are various ways we
6 min read
Arithmetic Operators in LISP
Arithmetic operators are used to perform mathematical operations like addition, subtraction, multiplication, and division. There are 7 arithmetic operators in LISP that are listed in the below table: OperatorSyntaxDescriptionAddition Operator(+)+ num1 num2Add the two numbersSubtraction Operator(-)-
2 min read
Arithmetic Operators in SQL Server
Arithmetic operators play a crucial role in performing mathematical calculations within SQL Server. These operators allow you to perform addition, subtraction, multiplication, division, and more on numeric data stored in your database tables. In this article, we'll explore the various arithmetic ope
4 min read
Arithmetic Operators in Solidity
Arithmetic operators are used to perform arithmetic or mathematical operations. Solidity has the following types of arithmetic operators: Addition: The addition operator takes two operands and results in a sum of these operands. It is denoted by +.Subtraction: The subtraction operator takes two oper
2 min read
Arithmetic Operators in Programming
Arithmetic operators are fundamental components of programming languages that allow developers to perform mathematical operations on numerical data types. These operators enable manipulation of numeric values, making them essential for various computational tasks. Table of Content What are Arithmeti
7 min read
Arithmetic Operators in MySQL
Arithmetic operators in MySQL are tools for performing basic math in database queries. They handle addition (+), subtraction (-), multiplication (*), division (/), and modulus (%) operations. These operators are vital for tasks like calculating totals, differences, products, quotients, and remainder
5 min read
Excel VBA Comparison Operators
VBA in Excel stands for Visual Basic for Applications which is Microsoft's programming language. To optimize the performance and reduce the time in Excel we need Macros and VBA is the tool used in the backend. Some helpful links to get more insights about Macros, VBA in Excel : 1. Record Macros in E
5 min read
Arithmetic Operators in PostgreSQL
PostgreSQL is an advanced relational database system that supports both relational (SQL) and non-relational (JSON) queries. It is free and open-source. One of the most fundamental properties of database systems is arithmetical operations, without which a multitude of tasks, from simple arithmetic to
8 min read
VBA Logical Operators in Excel
Logical operators are used for performing logical and arithmetic operations on a set of values or variables. VBA allows you to use the Logical operators AND, OR, NOT, and XOR to compare values. The operators are considered "Boolean" which means they return True or False as a result. In Excel VBA, lo
6 min read
Arithmetic Operations
Arithmetic Operations are the basic mathematical operationsâAddition, Subtraction, Multiplication, and Divisionâused for calculations. These operations form the foundation of mathematics and are essential in daily life, such as sharing items, calculating bills, solving time and work problems, and in
10 min read