{"items":["5fda1ff2ffb0f20017abdb74","5fda1ff2ffb0f20017abdb70","5fda1ff2ffb0f20017abdb71"],"styles":{"galleryType":"Columns","groupSize":1,"showArrows":true,"cubeImages":true,"cubeType":"max","cubeRatio":1.7777777777777777,"isVertical":true,"gallerySize":30,"collageAmount":0,"collageDensity":0,"groupTypes":"1","oneRow":false,"imageMargin":5,"galleryMargin":0,"scatter":0,"rotatingScatter":"","chooseBestGroup":true,"smartCrop":false,"hasThumbnails":false,"enableScroll":true,"isGrid":true,"isSlider":false,"isColumns":false,"isSlideshow":false,"cropOnlyFill":false,"fixedColumns":0,"enableInfiniteScroll":true,"isRTL":false,"minItemSize":50,"rotatingGroupTypes":"","rotatingCropRatios":"","columnWidths":"","gallerySliderImageRatio":1.7777777777777777,"numberOfImagesPerRow":3,"numberOfImagesPerCol":1,"groupsPerStrip":0,"borderRadius":0,"boxShadow":0,"gridStyle":0,"mobilePanorama":false,"placeGroupsLtr":true,"viewMode":"preview","thumbnailSpacings":4,"galleryThumbnailsAlignment":"bottom","isMasonry":false,"isAutoSlideshow":false,"slideshowLoop":false,"autoSlideshowInterval":4,"bottomInfoHeight":0,"titlePlacement":["SHOW_ON_THE_LEFT","SHOW_BELOW"],"galleryTextAlign":"center","scrollSnap":false,"itemClick":"nothing","fullscreen":true,"videoPlay":"hover","scrollAnimation":"NO_EFFECT","slideAnimation":"SCROLL","scrollDirection":0,"scrollDuration":400,"overlayAnimation":"FADE_IN","arrowsPosition":0,"arrowsSize":23,"watermarkOpacity":40,"watermarkSize":40,"useWatermark":true,"watermarkDock":{"top":"auto","left":"auto","right":0,"bottom":0,"transform":"translate3d(0,0,0)"},"loadMoreAmount":"all","defaultShowInfoExpand":1,"allowLinkExpand":true,"expandInfoPosition":0,"allowFullscreenExpand":true,"fullscreenLoop":false,"galleryAlignExpand":"left","addToCartBorderWidth":1,"addToCartButtonText":"","slideshowInfoSize":200,"playButtonForAutoSlideShow":false,"allowSlideshowCounter":false,"hoveringBehaviour":"NEVER_SHOW","thumbnailSize":120,"magicLayoutSeed":1,"imageHoverAnimation":"NO_EFFECT","imagePlacementAnimation":"NO_EFFECT","calculateTextBoxWidthMode":"PERCENT","textBoxHeight":26,"textBoxWidth":200,"textBoxWidthPercent":65,"textImageSpace":10,"textBoxBorderRadius":0,"textBoxBorderWidth":0,"loadMoreButtonText":"","loadMoreButtonBorderWidth":1,"loadMoreButtonBorderRadius":0,"imageInfoType":"ATTACHED_BACKGROUND","itemBorderWidth":0,"itemBorderRadius":0,"itemEnableShadow":false,"itemShadowBlur":20,"itemShadowDirection":135,"itemShadowSize":10,"imageLoadingMode":"BLUR","expandAnimation":"NO_EFFECT","imageQuality":90,"usmToggle":false,"usm_a":0,"usm_r":0,"usm_t":0,"videoSound":false,"videoSpeed":"1","videoLoop":true,"jsonStyleParams":"","gallerySizeType":"px","gallerySizePx":292,"allowTitle":true,"allowContextMenu":true,"textsHorizontalPadding":-30,"itemBorderColor":{"themeName":"color_12","value":"rgba(220,226,233,0)"},"showVideoPlayButton":true,"galleryLayout":2,"calculateTextBoxHeightMode":"MANUAL","targetItemSize":292,"selectedLayout":"2|bottom|1|max|true|0|true","layoutsVersion":2,"selectedLayoutV2":2,"isSlideshowFont":true,"externalInfoHeight":26,"externalInfoWidth":0.65},"container":{"width":300,"galleryWidth":305,"galleryHeight":0,"scrollBase":0,"height":null}}

# Order of Operator Precedence in Excel

Whenever you are constructing large formulas with several operators it’s important to understand the order in which Excel will perform the calculation. This order is called the operator precedence. You can force Excel to perform the calculation in the order you want by using parentheses to specify what operation to calculate first.

### The Order of Operations

Below is a table which shows the order or operations for Excel.

Multiplication and division have the same order precedence. The comparison operators also have the same order precedence. If the formula contains operators with the same order precedence then Excel will evaluate the operators from left to right.

Let’s look at an example of how Excel calculates formulas with and without parenthesis.

The formula 5+5*2 will return 15 because it will calculate 5*2 first as multiplication has a higher order precedence than addition. It will then add 5 to give an answer of 15. However, I want to perform the 5+5 calculation first so I therefore need to put parenthesis around this. The formula will now be (5+5)*2 so the answer will be 20.

Let’s have a look at a more advanced example.

I have a list of numbers in the cell range A1:A5. I want to add these figures and then multiply it by 6-3. Without the parenthesis the formula will be =6-3*SUM(A1:A5). The answer will return -213. I have broken this down to show you how Excel will calculate this formula.

**Step 1**

In this formula the range operator (:) has the highest precedence so it calculates the SUM(A1:A5) first which is 73.

**Step 2**

The multiplication has the second highest precedence so it calculates 3*73 which is 219.

**Step 3**

The minus (-) has the least precedence so therefore does the minus calculation last. The calculation now is =6-219 which results in -213.

This is not the answer I want. I want to calculate the 6-3 first and then multiply by SUM(A1:A5). In order to do that I put parenthesis around 6-3. The correct formula is =(6-3)*SUM(A1:A5). This is how Excel now calculates the formula.

**Step 1**

Because there is parentheses around 6-3 Excel will calculate this first. The answer is of course 3.

**Step 2**

Excel now calculates SUM(A1:A5) next as the range operator has the next highest precedence. The answer is 73.

**Step 3**

Excel now multiplies 3 by 73 and returns 219.

### Multiple Parenthesis

When a formula has multiple parenthesis then Excel will calculate from the inside out. The below steps is the process of how the formula =5*(100-(4*4)/2) is worked out by Excel.

**Step 1**

First Excel works out (4*4) which is 16. The formula will be =5*(100-16/2)

**Step 2**

Now Excel will calculate 16/2 next as division has a higher precedence than subtraction. The formula will be =5*(100-8)

**Step 3**

Now Excel will calculate (100-8) which is 92. It will then multiply this by 5. The formula is =5*92 and the result is 460.

### Conclusion

Knowing the order of operator precedence is extremely important if you want to create complex formulas. If they are not written correctly then they will display incorrect results. Using parenthesis in your formulas are therefore critically important.

A common problem with using parenthesis however is when you start to open them you forget to close them all. Excel will display an error message saying it found a mistake and will offer to close the formula with a parenthesis. The problem with this however is that if you click the Yes button it will put the closing parenthesis at the end of the formula which sometimes is not correct and will therefore display an incorrect result. It is important to know where the closing parenthesis should be.

I hope you enjoyed this blog. I would love to hear from you. Please leave your comments below.