Modify the MOD function for divisors larger than the number
As seen in our previous example, a problem occurs when the divisor is larger than the number for which you want to find the remainder. The result will always be the number itself. To handle this using the MOD function, follow these steps.
Handling divisors that are larger than the number:
- Select cells A2:A10 and enter 100.
- Press Ctrl+Enter.
- In cells B2:B10 enter different divisors.
- Select cells C2:C10 and type this formula: =A2/B2.
- Press Ctrl+Enter.
- Select cells D2:D10 and type this formula: =MOD(A2,B2)*(A2>B2).
- Press Ctrl+Enter.
This tip is compatible with Excel 97, 2000, 2003 and 2007.
