Convince Excel to Treat a - as a Minus Sign in calculations and not a Negative

Posted on 2014-08-15
Last Modified: 2014-08-25
I understand why Excel is doing this as per this document, but I want to change the calculation order to not be a negative as I want it treated as an operator i.e. a minus.


2/4-3+9*6 = 51.5 according to Excel and Google treated as (2/4)-3+9*6 I think.

I however want it to calculate like this:

Division First = 2-3+9*6
Multiplication Second = 2-3+54
Addition Third = 2-57
Subtraction Last = -55

Any way I can change this behaviour with a custom function or indeed something else?
Question by:Alex Haines
    LVL 25

    Expert Comment

    by:Shaun Kline
    First, 2 divided by four is not 2. It is 0.5. Do you have this formula written correctly?

    If you want the operations to occur in that fashion, utilize parentheses.

    LVL 25

    Expert Comment

    by:Shaun Kline
    Also, as a point of clarification, the link your provided is not specific to Excel. In math, the order of operations is always handled using the PEDMAS rule: Parenthesis, Exponents, Division/Multiplication, Addition/Subtraction.

    Author Comment

    by:Alex Haines
    Sorry my mistake:

    Division First = 0.5-3+9*6
    Multiplication Second = 0.5-3+54
    Addition Third = 0.5-57
    Subtraction Last = -56.5

    Yes I could be using brackets but I was hoping not to have to. Perhaps it is easier to show you the spreadsheet. Macros are in there for the custom formula.problem.xlsm

    Author Comment

    by:Alex Haines
    Sorry Shaun, I replied to your first comment and then saw the second. Yes I know it is following BODMAS (as we called it in my school days) but it is the minus sign that is being handled against my wishes and interpreted as a negative number i.e. negative 3 (0-3) not x-3=y.
    LVL 25

    Accepted Solution

    It may not be doing what you want, but it is doing what it is supposed to, as written. Another way of writing that formula, per math rules, would be:

    ((2/4) - 3) + (9 * 6)

    If you want both the 3 and 9 * 6 subtracted from the first part, you would either need to use brackets or distribute the minus sign:

    2/4 - (3 + (9 * 6))   or (2/4) - 3 - (9 * 6)

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Should I Do With This Threat Intelligence?

    Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

    I've recently been in need of an Excel macro that could add a letter before the text on multiple cells in an Excel document. My English is as it is, so I will try explain what it does diffrently. If you have an excel document with 2000 rows an…
    Approximate matching with VLOOKUP and MATCH seems to me to be a greatly under-used technique, and one which is vital for getting good performance out of large lookups. Until recently I would always have advised using an exact match for simplicity an…
    Viewers will learn the basics of slicers and timelines for both PivotTables and standard Excel tables in Excel 2013.
    This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    10 Experts available now in Live!

    Get 1:1 Help Now