Microsoft Excel is a handy software. We use Excel functions and features for our educational, business, and other daily life purposes. Furthermore, Excel provides some cool functions to extract the remainder in our workbooks. This article will show you 3 simple methods to get the remainder in Excel.
Obtaining remainders in Excel can be really cumbersome if we do not know the right functions to implement. In this article, I will show you 3 easy methods to get the remainder in Excel. For instance, we take a dataset that contains numbers of division.
1. Getting Remainder Using Excel MOD Function
This method demonstrates how to carry out the modulo operation in Excel using the MOD function. Additionally, we will see how finding the remainder is so easy with the MOD function. In Excel, the MOD function stands for modulo or modulus that divides numbers. The MOD function returns the remainder as a response, unlike ordinary division. The syntax of the MOD function is:
Here, the divisor is the number by which you want to divide the number argument. The number is the number that the function divides with. We use the number argument with a cell reference to the location of the data in a worksheet or a number put directly into the function. Let’s use the applications of the MOD function step by step.
- Firstly, in cell D5, insert the following formula,
- In these arguments, B5 represents the Dividend and C5 indicates Divisor.
- Now, press Enter or Tab to get the remainder of the division in D5.
- Afterward, AutoFill the rest of the cells by dragging the formula cell down to D9.
- As a result, we get the rest of the remainder in column D.
2. Going to the Formula Tab to Attain Remainder
In this method, we will use Excel’s predefined MOD function. Excel provides some powerful by-default functions. In this case, we will access the Formulas tab to apply the MOD function. The MOD function is under the category of Math & Trig functions. Follow these steps to learn how to implement this.
- First, go to the Formulas tab and then click Math & Trig dropdown icon.
- See the below picture to understand better.
- Eventually, a context menu will open up.
- Next, scroll down to select the MOD option.
- Consequently, the Functions Arguments dropbox will pop up.
- Now, click in the Number box, and select B5 as the number.
- Similarly, tap the Divider box, and click on cell C5.
- Lastly, press OK.
- Thus, we get the remainder in D5.
- Continue this process to the other cells one by one to finally get all the desired remainders.
3. Extracting Remainder Through Excel VBA
In Excel VBA, the Mod operator returns the remaining portion of a division. With this in mind, in the last method, we will extract the remainder using Excel VBA. Firstly, we will create a UserForm to design a division calculator that returns a remainder as an output. We can customize our UserForm as we wish and insert a command button to execute the division. Further, we will use a simple VBA code to assist us in the division process. Follow the steps carefully to do so.
- First, go to the Developer tab and tap Visual Basic. Also, you can press F11 to open the Visual Basic window directly.
- Hence, the Visual Basic Window opens up.
- Later, click Insert and then UserForm to create UserForm1.
- Here, customize your UserForm as you wish.
- Now, right-click on the command button that you customized earlier.
- Next, select View Code to display a module box.
- Afterward, in the module box, type the following VBA code.
Private Sub CommandButton1_Click()
Dividend = UserForm1.TextBox1.Value
Divisor = UserForm1.TextBox2.Value
If Dividend & Divisor <> "" Then
Remainder = Dividend Mod Divisor
MsgBox "The Desired Remainder is " & Remainder, , "Get Remainder"
- As soon you finish writing the code, go to the green Run button.
- See the picture below for a better understanding.
- After running the code, we will see the input menu on the display.
- Further, put the dividend and divisor numbers in the input boxes.
- Lastly, press Calculate command option.
- Thus, we will the remainder as an output.
- Calculate each row one by one to get all the values.
Download Practice Workbook
You can download this workbook to practice yourself.
In conclusion, we have discussed some simple methods to get the remainder in Excel. Not to mention, our ExcelDemy website shows various simple problem-solving methods like this. Please leave any further queries or recommendations in the comment box below.