Copilot for Microsoft 365 Tech Accelerator
Feb 28 2024 07:00 AM - Feb 29 2024 10:30 AM (PST)
Microsoft Tech Community
SOLVED

# The & operator is changing the subtraction operator (-)

Copper Contributor

# The & operator is changing the subtraction operator (-)

In cell B9, I am using the formula     ="Dichloram = "&(B8-A8)

Cell B8 has the value 2.12

Cell A8 has the value of 2.03

Therefore (B8-A8) should be 0.09 and if I type =(G8-F8) into a cell it returns 0.09

However, the formula "Dichloram = "&(B8-A8) returns Dichloram = 0.09000000000000003

The same formula with different values other than 2.12 and 2.03 seems to work.

Microsoft® Excel® for Microsoft 365 MSO (Version 2310 Build 16.0.16924.20054) 32-bit

Windows 11 on PC

3 Replies
best response confirmed by Susan_Oster (Copper Contributor)
Solution

# Re: The & operator is changing the subtraction operator (-)

That's floating point error. You may use instead

``="Dichloram = " & TEXT(B8-A8, "0.00")``

or like

# Re: The & operator is changing the subtraction operator (-)

Thank you! Today I learned about floating point errors!

# Re: The & operator is changing the subtraction operator (-)

@Susan_Oster , you are welcome

1 best response

Accepted Solutions
best response confirmed by Susan_Oster (Copper Contributor)
Solution

# Re: The & operator is changing the subtraction operator (-)

That's floating point error. You may use instead

``="Dichloram = " & TEXT(B8-A8, "0.00")``

or like