The tutorial shows how to use a division formula in Excel to divide numbers, cells or entire columns and how to handle Div/0 errors.
As with other basic math operations, Microsoft Excel provides several ways to divide numbers and cells. Which one to use depends on your personal preferences and a particular task you need to solve. In this tutorial, you will find some good examples of using a division formula in Excel that cover the most common scenarios.
The common way to do division is by using the divide sign. In mathematics, the operation of division is represented by an obelus symbol (÷). In Microsoft Excel, the divide symbol is a forward slash (/).
With this approach, you simply write an expression like =a/b with no spaces, where:
To divide two numbers in Excel, you type the equals sign (=) in a cell, then type the number to be divided, followed by a forward slash, followed by the number to divide by, and press the Enter key to calculate the formula.
For example, to divide 10 by 5, you type the following expression in a cell:
The screenshot below shows a few more examples of a simple division formula in Excel:
When a formula performs more than one arithmetic operation, it is important to remember about the order of calculations in Excel (PEMDAS): parentheses first, followed by exponentiation (raising to power), followed by multiplication or division whichever comes first, followed by addition or subtraction whichever comes first.
To divide cell values, you use the divide symbol exactly like shown in the above examples, but supply cell references instead of numbers.
I have to say plainly: there is no Divide function in Excel. Whenever you want to divide one number by another, use the division symbol as explained in the above examples.
However, if you want to return only the integer portion of a division and discard the remainder, then use the QUOTIENT function:
When two numbers divide evenly without remainder, the division symbol and a QUOTIENT formula return the same result. For example, both of the below formulars return 2.
When there is a remainder after division, the divide sign returns a decimal number and the QUOTIENT function returns only the integer part. For example:
=5/4 returns 1.25
=QUOTIENT(5,4) yields 1
As simple as it seems, the Excel QUOTIENT function still has a few caveats you should be aware of:
Dividing columns in Excel is also easy. It can done by copying a regular division formula down the column or by using an array formula. Why would one want to use an array formula for a trivial task like that? You will learn the reason in a moment :)
To divide columns in Excel, just do the following:
Since we use relative cell references (without the $ sign), our division formula will change based on a relative position of a cell where it is copied:
Tip. In a similar fashion, you can divide two rows in Excel. For example, to divide values in row 1 by values in row 2, you put
=A1/A2 in cell A3, and then copy the formula rightwards to as many cells as necessary.
In situations when you want to prevent accidental deletion or alteration of a formula in individual cells, insert an array formula in an entire range.
For example, to divide the values in cells A2:A8 by the values in B2:B8 row-by-row, use this formula:
To insert the array formula correctly, perform these steps:
As the result, you will have the numbers in column A divided by the numbers in column B in one fell swoop. If someone tries to edit your formula in an individual cell, Excel will show a warning that part of an array cannot be changed.
To delete or modify the formula, you will need to select the whole range first, and then make the changes. To extend the formula to new rows, select the entire range including new rows, change the cell references in the formula bar to accommodate new cells, and then press Ctrl + Shift + Enter to update the formula.
Depending on whether you want the output to be formulas or values, you can divide a column of numbers by a constant number by using a division formula or Paste Special feature.
As you already know, the fastest way to do division in Excel is by using the divide symbol. So, to divide each number in a given column by the same number, you put a usual division formula in the first cell, and then copy the formula down the column. That's all there is to it!
For example, to divide values in column A by the number 5, insert the following formula in A2, and then copy it down to as many cells as you want:
As explained in the above example, the use of a relative cell reference (A2) ensures that the formula gets adjusted properly for each row. That is, the formula in B3 becomes
=A3/5, the formula in B4 becomes
=A4/5, and so on.
Instead of supplying the divisor directly in the formula, you can enter it in some cell, say D2, and divide by that cell. In this case, it's important that you lock the cell reference with the dollar sign (like $D$2), making it an absolute reference because this reference should remain constant no matter where the formula is copied.
As shown in the screenshot below, the formula
=A2/$D$2 returns exactly the same results as
In case you want the results to be values, not formulas, you can do division in the usual way, and then replace formulas with values. Or, you can achieve the same result faster with the Paste Special > Divide option.
Alternatively, right-click the selected numbers, select Paste Special… from the context menu, then select Divide under Operation, and click OK.
Either way, each of the selected numbers in column A will be divided by the number in D5, and the results will be returned as values, not formulas:
Since percentages are parts of larger whole things, some people think that to calculate percentage of a given number you should divide that number by percent. But that is a common delusion! To find percentages, you should multiply, not divide. For example, to find 20% of 80, you multiply 80 by 20% and get 16 as the result: 80*20%=16 or 80*0.2=16.
In what situations do you divide a number by percentage? For instance, to find X if a certain percent of X is Y. To make things clearer, let's solve this problem: 100 is 25% of what number?
To get the answer, convert the problem to this simple equation:
With Y equal to 100 and P to 25%, the formula takes the following shape:
Since 25% is 25 parts of a hundred, you can safely replace the percentage with a decimal number:
As shown in the screenshot below, the result of both formulas is 400:
For more examples of percentage formulas, please see How to calculate percentages in Excel.
Division by zero is an operation for which there exists no answer, therefore it is disallowed. Whenever you try to divide a number by 0 or by an empty cell in Excel, you will get the divide by zero error (#DIV/0!). In some situations, that error indication might be useful, alerting you about possible faults in your data set.
In other scenarios, your formulas can just be waiting for input, so you may wish to replace Excel Div 0 error notations with empty cells or with your own message. That can be done by using either an IF formula or IFERROR function.
The easiest way to handle the #DIV/0! error in Excel is to wrap your division formula in the IFERROR function like this:
The formula checks the result of the division, and if it evaluates to an error, returns an empty string (""), the result of the division otherwise.
Please have a look at the two worksheets below. Which one is more aesthetically pleasing?
Note. Excel's IFERROR function disguises not only #DIV/0! errors, but all other error types such as #N/A, #NAME?, #REF!, #VALUE!, etc. If you'd like to suppress specifically DIV/0 errors, then use an IF formula as shown in the next example.
To mask only Div/0 errors in Excel, use an IF formula that checks if the divisor is equal (or not equal) to zero.
If the divisor is any number other than zero, the formulas divide cell A2 by B2. If B2 is 0 or blank, the formulas return nothing (empty string).
Instead of an empty cell, you could also display a custom message like this:
=IF(B2<>0, A2/B2, "Error in calculation")
If you are making your very first steps in Excel and do not feel comfortable with formulas yet, you can do division by using a mouse. All it takes is our Ultimate Suite installed in your Excel.
In one of the examples discussed earlier, we divided a column by a number with Excel's Paste Special. That involved a lot of mouse movement and two shortcuts. Now, let me show you a shorter way to do the same.
Done! The entire column is divided by the specified number in the blink of an eye:
As with Excel Paste Special, the result of division is values, not formulas. So, you can safely move or copy the output to another location without worrying about updating formula references. You can even move or delete the original numbers, and your calculated numbers will be still safe and sound.
That is how you divide in Excel by using formulas or Calculate tools. If are curious to try this and many other useful features included with the Ultimate Suite for Excel, you are welcome to download 14-day trial version.
To have a closer look at the formulas discussed in this tutorial, feel free to download our Excel Division formula examples.
I thank you for reading and hope to see you on our blog next week!
Table of contents