+ Reply to Thread
Results 1 to 4 of 4

Does a bracketed calculation always get performed first?

  1. #1
    Ed
    Guest

    Does a bracketed calculation always get performed first?

    Cell formula
    =b2/(c4+c5)
    I know that in this case, c4+c5 will get performed first because it is in
    brackets.

    Now, here is my question.
    =ROUNDUP((D6/D7),0)

    In this formula, do the brackets around the division cause the division to
    be performed first even though they are within the roundup brackets?
    Or would it do the division first anyway, without the brackets?

    I am thinking that the default procedure would do the division first without
    the brackets.
    But, by adding the brackets, I give the computer definite instructions which
    eliminates a possible problem. (I hope this is so.)
    Do you agree with my thinking?
    Ed

  2. #2
    Duke Carey
    Guest

    RE: Does a bracketed calculation always get performed first?

    Excel has to resolve the D6/D7 portion BEFORE it can do the ROUNDUP, so your
    parentheses are superfluous

    "Ed" wrote:

    > Cell formula
    > =b2/(c4+c5)
    > I know that in this case, c4+c5 will get performed first because it is in
    > brackets.
    >
    > Now, here is my question.
    > =ROUNDUP((D6/D7),0)
    >
    > In this formula, do the brackets around the division cause the division to
    > be performed first even though they are within the roundup brackets?
    > Or would it do the division first anyway, without the brackets?
    >
    > I am thinking that the default procedure would do the division first without
    > the brackets.
    > But, by adding the brackets, I give the computer definite instructions which
    > eliminates a possible problem. (I hope this is so.)
    > Do you agree with my thinking?
    > Ed


  3. #3
    Biff
    Guest

    Re: Does a bracketed calculation always get performed first?

    Hi!

    >But, by adding the brackets, I give the computer definite instructions
    >which
    >eliminates a possible problem. (I hope this is so.)
    >Do you agree with my thinking?


    Yes! But in the case of your example it's not necessary since it is only a
    single math operation to divide D6 by D7.

    In your first example the order of precedence is not exactly as you think
    (but you're close!)

    =b2/(c4+c5)

    Assume:

    B2 = 10
    C4 = 5
    C5 = 5

    B2/ gets evaluated first, not (C4+C5)

    So:

    10/(C4+C5)

    10/10 = 1

    Biff

    "Ed" <Ed@discussions.microsoft.com> wrote in message
    news:62A0A2FD-52B4-477F-940A-FE221C5A00E7@microsoft.com...
    > Cell formula
    > =b2/(c4+c5)
    > I know that in this case, c4+c5 will get performed first because it is in
    > brackets.
    >
    > Now, here is my question.
    > =ROUNDUP((D6/D7),0)
    >
    > In this formula, do the brackets around the division cause the division to
    > be performed first even though they are within the roundup brackets?
    > Or would it do the division first anyway, without the brackets?
    >
    > I am thinking that the default procedure would do the division first
    > without
    > the brackets.
    > But, by adding the brackets, I give the computer definite instructions
    > which
    > eliminates a possible problem. (I hope this is so.)
    > Do you agree with my thinking?
    > Ed




  4. #4
    Bob Phillips
    Guest

    Re: Does a bracketed calculation always get performed first?

    Nope. The brackets are totally superfluous in this instance. Excel follows
    normal arithmetic conventions, BODMAS I believe is the acronym.

    In the example you show, there is only one operator, the divide. This will
    be resolved before the function, ROUND, is applied to it. IMO brackets
    should be used to change the normal operator precedence, to force an
    operator to act upon more elements than it would by default, or to group a
    set of calculations for clarity within a complex formula. Whilst your usage
    is negligible, neither criteria apply in your example, and unnecessary
    brackets in complex formulae can make them far more difficult to debug.

    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "Ed" <Ed@discussions.microsoft.com> wrote in message
    news:62A0A2FD-52B4-477F-940A-FE221C5A00E7@microsoft.com...
    > Cell formula
    > =b2/(c4+c5)
    > I know that in this case, c4+c5 will get performed first because it is in
    > brackets.
    >
    > Now, here is my question.
    > =ROUNDUP((D6/D7),0)
    >
    > In this formula, do the brackets around the division cause the division to
    > be performed first even though they are within the roundup brackets?
    > Or would it do the division first anyway, without the brackets?
    >
    > I am thinking that the default procedure would do the division first

    without
    > the brackets.
    > But, by adding the brackets, I give the computer definite instructions

    which
    > eliminates a possible problem. (I hope this is so.)
    > Do you agree with my thinking?
    > Ed




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1