<!-- https://learnsql.cpetoday.com/functions/m/number-integerdivide -->
# Number.IntegerDivide

Language: Power Query M
Category: Number
Syntax: Number.IntegerDivide(number as nullable number, divisor as number, optional precision as any) as nullable number
Summary: Divides one number by another and keeps only the whole number of times it fits.
Returns: The whole part of the division, or null when the input is null.
Level: Intermediate
Related: Number.Mod, Number.RoundDown, Number.Round, Number.Abs, Number.Power

## What it does
Number.IntegerDivide answers "how many complete units fit" without any decimal part. It is the whole number version of a division. Use it when a fraction makes no sense, such as the number of full pallets, full weeks, or complete installments. Pair it with Number.Mod to get the leftover.
## Syntax and arguments
- number: the amount to divide.
- divisor: the size of each unit.
- precision (optional): a setting for the arithmetic used. Leave it out for whole numbers.
## Example
A company pays a loan in full installments of 250 dollars. The question is how many full installments a balance covers, and how much is left over.

```powerquery
let
    Balance = 1080,
    Installment = 250,
    FullPayments = Number.IntegerDivide(Balance, Installment),
    Remainder = Number.Mod(Balance, Installment)
in
    {FullPayments, Remainder}
```

1080 divided by 250 gives 4 full installments, with 80 left over, so the result is {4, 80}. The remainder is the amount that does not make a full installment.
## Example: a second, different use
Work out how many complete pallets of a given count fit into a shipment, and how many units are left for a partial pallet.
## Things to watch
- It drops the fraction. 1080 divided by 250 is 4.32, and the function returns 4.
- Number.RoundDown gives the same answer for positive numbers, but the name of this function says what you mean.
- The divisor must not be zero.
- Null in gives null out.
## In business terms
Installments, pallets, billing units and full periods are whole quantities. Taking the whole part of a division makes the query say that directly, which is easier for a reviewer than a long division formula.
