COMBIN
Returns the number of combinations for selecting k items from n.
COMBIN evaluates n choose k using truncated integer inputs.
The Formualizer engine in this repository at 0.15.0 plus unreleased changes computes the example results. Known differences from Excel are listed on this page.
Syntax
=COMBIN(number, number_chosen)
Arguments
| Argument | Type | Required | Default |
|---|---|---|---|
number | number | Required | — |
number_chosen | number | Required | — |
Remarks
- Fractional inputs are truncated toward zero before evaluation.
- Argument errors propagate directly.
Error cases
- If
n < 0,k < 0, ork > n, the function returns#NUM!.
Examples
Count selections of size two from a population of five.
Formula =COMBIN(5,2)
Expected result 10
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
Compare the result when selecting a single member.
Formula =COMBIN(5,1)
Expected result 5
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
Count the ways to make an empty selection.
Formula =COMBIN(5,0)
Expected result 1
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
A negative population size is invalid.
Formula =COMBIN(-1,2)
Expected result #NUM!
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
Fractional arguments are truncated
Formula =COMBIN(6.9, 3.2)
Expected result 20
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
Invalid k returns numeric error
Formula =COMBIN(3, 5)
Expected result #NUM!
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
Related functions
FAQ
When does COMBIN return #NUM!?
It returns #NUM! if n or k is negative, or if k is greater than n after truncation.
Can COMBIN take non-integer values?
Yes, but both inputs are truncated toward zero before evaluation.