Excel VBA Operators in Office 365 with Examples!!
Tags: vbamacros, vbaoperators
Published: 2020-12-21 04:00:15

---
title: Excel VBA Operators in Office 365 with Examples!!
published: true
date: 2020-12-19 12:30:46 UTC
tags: VBAMacros,VBAoperators
canonical_url: https://geekexcel.com/excel-vba-operators/
---

An operator is a symbol that tells the compiler to perform certain mathematical or logical operations. Here, we will show the list of [VBA](https://geekexcel.com/excel-office-365-vba-overview-definition-and-examples/) operators available in Excel. Let’s get into this article!!

### Types of Operators:

There are four kinds of operators available in Excel VBA.

![Operators Types](https://eadn-wc04-371788.nxedge.io/cdn/wp-content/uploads/2020/12/image-1-1.png)<figcaption id="caption-attachment-20087">Operators Types</figcaption>

## Jump To:
## VBA Arithmetic Operators:

The Arithmetic operators are used to perform basic mathematical operations such as addition, subtraction, multiplication, and division. Let’s see the below table that contains all arithmetic operators in Excel.

| Arithmetic Operators | Description | Example |
| --- | --- | --- |
| (+) Plus sign | It is used to add two values. | 5+5=10 |
| (-) Minus sign | Helps to subtract the values. | 5-2=3 |
| (\*) Asterisk or Multiplication | This operator is used to multiply or getting the product of two or more values. | 5\*2=10 |
| (/) Forward Slash or Division | It helps to divide the numerator by denominator. | 6/2=3 |
| (%) Percentage sign | It is a modulus operator and helps to return the remaining value after an integer division | 6%3=0 |
| (^) Caret | This is an exponential operator. | 5^2=10 |

## VBA Comparison Operators:

The comparison operator is used to compare the two values and return the result as TRUE or FALSE.

Assume that A=10 and B=10, let’s see the below table:

| Comparison Operators | Description | Example (A=10 and B=20) |
| --- | --- | --- |
| (=) Equal sign | It will check the two values are equal or not. If yes, then the condition is true otherwise it false. | (A=B ) is False |
| (>) Greater than sign | This operator will check if the left value is greater than the right value. If yes, then the condition returns True. | (A>B) is False |
| (<) Less than sign | It will check if the left value is less than the right value. If yes, then the condition returns True. | (A<B) is True |
| (>=) Greater than or equal to sign | Helps to check if the left value is greater than or equal to the right value. If yes, then the condition returns True. | (A>=B) is False |
| (<=) Less than or equal to sign | This sign is used to check if the left value is less than or equal to the right value. If yes, then the condition returns True. | (A<=B) is True |
| (<>) Not equal to sign | It will check the two values are equal or not. If the values are not equal means then the condition is True. | (A<>B) is TRUE |

## VBA Concatenation Operators:

The concatenation operators are used for joining two or more text strings to produce one continuous test string. In other words, these operators are used to add two values as continuous numeric.

For Example, we are going to see the performance of concatenation functions, assume that  A1=Best and B1= Wishes.

| Concatenation Operators | Description | Example |
| --- | --- | --- |
| (&) Ampersand | It is used to join the two text strings | (A1 and B1) is “BestWishes” |
| (+) Plus sign | It helps to add two strings and returns into one string | (A1 and B1) is “BestWishes” |

## VBA Logical Operators:

Logical operators are used to evaluating more than one condition. The following table shows the logical operators available in Excel VBA.

| Arithmetic Operators | Description | Example (A=5 and B=0) |
| --- | --- | --- |
| AND | Logical AND Operator. If both conditions are TRUE, then the Expression is true. | (A>0 AND B<>0) is False |
| OR | Logical OR operator. If any of the two conditions are true then the condition is true | (A<>0 OR B<>0) is True |
| NOT | It is called Logical NOT operator. Used to reverse the logical state of the operand. If  a condition is true, then the Logical Not operator will make false | NOT (A<>0 NOT B<>0) True |

## A Brief Summary:

Here, you can get to know the list of **Operators available in Excel VBA**.  I hope it was helpful. If you have any doubts regarding the operators in VBA, ask in the **comment** section below. We will assist you.

### Related Articles:

- **[Excel VBA String Functions in Office 365 ~ Work with String Functions!!](https://geekexcel.com/excel-vba-string-functions-office-365/)**
- [**Excel VBA Constants in Office 365 ~ Useful Guide!!**](https://geekexcel.com/excel-vba-constants/)