Dot and Scope Operators

What Is a Dot Operator in Excel?

Excel formulas have no dot operator. The dot appears as a decimal point, in some names and in VBA, where it reaches an object's properties and methods.

On this page
  1. The short answer: Excel formulas have no dot operator
  2. Where the dot does appear: decimal points and names
  3. The dot in VBA: reaching into objects
  4. How this compares with the dot in C++
  5. The operators Excel formulas do use
  6. Key points to remember

The short answer: Excel formulas have no dot operator

Excel’s worksheet formulas do not have a dot operator. You will not find a . that reaches into a value’s parts the way the dot does in C++. The dot does appear in Excel in a few other places, covered below.

Where the dot does appear: decimal points and names

  • Decimal points. In many English-language settings, the dot is the decimal separator, so =2.5*4 returns 10. Some regions use a comma instead, so the same number is typed as 2,5.
  • Names. Excel defined names can include periods, so a name such as Sales.Total is allowed. The period is just part of the name. It is not an operator.

The dot in VBA: reaching into objects

The dot becomes a real operator in VBA, the programming language built into Excel. In VBA, it reaches an object’s properties and methods:

Sub ShowValue()
    Range("A1").Value = 10
    MsgBox Range("A1").Value
End Sub

Range("A1") returns an object that represents a cell, and .Value is one of its properties. The first line sets the cell’s value to 10, and MsgBox shows it. Methods use the same dot. For example, Range("A1").ClearContents clears the cell’s contents.

How this compares with the dot in C++

The idea is the same in both: the dot connects an object to something that belongs to it. In C++, p.x reaches the member x of an object p. In VBA, Range("A1").Value reaches the Value property of a range object. The difference is that worksheet formulas do not use the dot this way, and VBA is a separate language from C++. For the C++ version, see The Dot Operator in C++.

The operators Excel formulas do use

If you were looking for the operators you can use in a worksheet formula, the main ones are:

  • Arithmetic: +, -, *, /, ^ (power) and % (percent, so =50% is 0.5).
  • Text: & joins two pieces of text, so ="Hi " & "there" returns Hi there.
  • Comparison: =, <> (not equal), <, >, <= and >=.

For more on the arithmetic group, see What Are Arithmetic Operators?

Key points to remember

  • Excel’s worksheet formulas do not have a dot operator.
  • In Excel, the dot is a decimal point in numbers, and it can be part of a defined name.
  • In VBA, the dot reaches an object’s properties and methods, such as Range("A1").Value.
  • The idea is close to the dot in C++, but the two work in separate languages.

The complete guide to dot and scope operators

The Dot Operator in C++
Read the guide

Keep exploring

Guides from other topics

All topics →