Short answer
The reason is a ambiguity of ^
symbol - it's used both, for Exponentiation (e.g. x to power of 2) and Declaring LongLong datatype.
This is related to 64-bit Excel (not 32-bit).
When aiming for exponentiation on 64-bit Excel, you could save some time by using space only before ^
symbol:
Square = x ^ 2 '4 spaces
Square=x ^2 '1 space
Longer Explanation
A similar question was raised in 2015 with respect to Excel 2013. QHarr's answer back then was (basically):
in 64-bit Excel versions circumflex character (^) [...] has 2 meanings:
A: to designate exponent operation
B. designate operand value as LongLong data type.
Current documentation from Microsoft supports this explanation . Notice the difference between:
- A. Exponentiation - under Arithmetic operations here
- B. declaring LongLong type here
I like to test things, so I ran the following code on 64-bit Excel 365, resulting in the mentioned output :
Debug.Print 2 ^ 2, VarType(2 ^ 2)
'output: 4, 5
Debug.Print 2^, VarType(2^)
'output: 2, 20
VarType 20 stands for LongLong and 5 for Double (link). In Other words, correct spacing is needed when working with ^
symbol on 64-bit Excel.