+ Reply to Thread
Results 1 to 14 of 14

Trying to add a division to a formula

  1. #1
    Forum Contributor Marvo's Avatar
    Join Date
    01-15-2009
    Location
    Northampton, England
    MS-Off Ver
    Excel 2021
    Posts
    1,007

    Trying to add a division to a formula

    Hi, I have this formula that works fine, in this case produces an answer of 55

    =COUNTIFS(ALL!$I:$I,"W",ALL!$H:$H,"League",ALL!$L:$L,$D$11)*3+COUNTIFS(ALL!$I:$I,"D",ALL!$H:$H,"League",ALL!$L:$L,$D$11)

    I now want to divide that result (55) by cell E11 which has a result of 38 to produce a final result of 1.44. However if I add /E11 to the formula above it results in 39.4. Obviously I've got it wrong somewhere

    =COUNTIFS(ALL!$I:$I,"W",ALL!$H:$H,"League",ALL!$L:$L,$D$11)*3+COUNTIFS(ALL!$I:$I,"D",ALL!$H:$H,"League",ALL!$L:$L,$D$11)/E11

    Any help appreciated, I'm guessing it's something pretty simple.
    Last edited by Marvo; 08-14-2019 at 05:38 AM.

  2. #2
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: Trying to add a division to a formula

    Do you remember bodmas (podmas outside of the UK) from your school days? 2 missing brackets make all the difference
    =(COUNTIFS(ALL!$I:$I,"W",ALL!$H:$H,"League",ALL!$L:$L,$D$11)*3+COUNTIFS(ALL!$I:$I,"D",ALL!$H:$H,"League",ALL!$L:$L,$D$11))/E11

  3. #3
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Trying to add a division to a formula

    What's in cell E11? An exact number, or a decimal/formula result, formatted to look like an integer???


    Edit: Jason's right (again).
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

  4. #4
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,418

    Re: Trying to add a division to a formula

    I don't remember "bodmas" - what's that?

    Pete

  5. #5
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Trying to add a division to a formula

    Brackets Orders Division Multiplication addition Subtraction....

  6. #6
    Forum Contributor Marvo's Avatar
    Join Date
    01-15-2009
    Location
    Northampton, England
    MS-Off Ver
    Excel 2021
    Posts
    1,007

    Re: Trying to add a division to a formula

    Thanks Jason. I guessed it was brackets but wouldn't have known I needed an extra one at the start. Much obliged.

    Ps: I've never heard of "bodmas" either.

  7. #7
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,418

    Re: Trying to add a division to a formula

    I'm not much the wiser …

    Pete

  8. #8
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Trying to add a division to a formula

    ... and you an Excel wizard!! it's the order in which mathematical operators should be processed

  9. #9
    Forum Contributor Marvo's Avatar
    Join Date
    01-15-2009
    Location
    Northampton, England
    MS-Off Ver
    Excel 2021
    Posts
    1,007

    Re: Trying to add a division to a formula

    So, if you dont mind, why is the first bracket added and placed where it is please?

  10. #10
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Trying to add a division to a formula

    Jason showed you the position of the two additional brackets in RED in his post. It makes the formula execute the full formula before the division. Without them only the second countifs is subject to division.

  11. #11
    Forum Contributor Marvo's Avatar
    Join Date
    01-15-2009
    Location
    Northampton, England
    MS-Off Ver
    Excel 2021
    Posts
    1,007

    Re: Trying to add a division to a formula

    Quote Originally Posted by Glenn Kennedy View Post
    Jason showed you the position of the two additional brackets in RED in his post. It makes the formula execute the full formula before the division. Without them only the second countifs is subject to division.
    Yes, saw that an added appropriately. I just wanted to understand why they were where they were. I think I've got it now now. Thanks.

  12. #12
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: Trying to add a division to a formula

    You said that the original formula gave the correct result, so enclosing the whole thing in one pair of brackets means that the original formula is recalculated before the division is carried out.

    Wthout the brackets, you were getting

    COUNTIFS(ALL!$I:$I,"W",ALL!$H:$H,"League",ALL!$L:$L,$D$11)*3

    COUNTIFS(ALL!$I:$I,"D",ALL!$H:$H,"League",ALL!$L:$L,$D$11)/E11

    added together, the division was done before the addition.

    The only other place that the opening bracket could have gone would be *(3+Countifs which would have also given an incorrect result due to the order in which it would calculate.

    Maybe bodmas was called something else at different points in time, I had never heard of 'the bus stop method' until recently (google it).

  13. #13
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,418

    Re: Trying to add a division to a formula

    Our school wasn't very strong on mnemonics …

    Pete

  14. #14
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Trying to add a division to a formula

    ... and I can't remember them...

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Division formula
    By dalypen in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 01-25-2016, 02:44 PM
  2. [SOLVED] Division formula?
    By rgreen0119 in forum Excel General
    Replies: 3
    Last Post: 01-18-2015, 08:44 PM
  3. [SOLVED] Division formula
    By Nubian in forum Excel General
    Replies: 12
    Last Post: 09-03-2012, 10:57 AM
  4. Division formula
    By DODGE in forum Excel General
    Replies: 0
    Last Post: 12-04-2011, 05:24 PM
  5. division gives wrong answer (division)
    By Brice in forum Excel General
    Replies: 5
    Last Post: 12-24-2010, 10:13 PM
  6. Excel Division Formula
    By Ron in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 08-08-2006, 07:45 PM
  7. division formula
    By Terrie in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 01-08-2005, 08:06 PM

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