COMBINA in Calligra Sheets: Syntax, Examples and Compatibility
Count unordered choices with replacement, including a documented KDE handbook discrepancy.
Verification status: Consult the documentation and examples below. Native application testing has not been documented for this guide. How formula examples are checked
Quick answer: combinations when repeats are allowed
COMBINA counts unordered selections of k items drawn from n available types, allowing repeated types. Think of picking three ice-cream scoops from four flavours: vanilla–vanilla–chocolate is one selection, and rearranging those scoops does not create another. For =COMBINA(4;3), 20 is the independently calculated result expected from the version-pinned implementation—not a value observed in Calligra Sheets. [E2, E3]
Do not substitute COMBIN: =COMBIN(4;3) would count 4 ways if every flavour were available only once. The difference is not cosmetic; it changes the underlying inventory/choice model. [E3]
Exact syntax and the KDE documentation discrepancy
=COMBINA(total;chosen)
Both arguments are required integers: total is the number of distinct types available, and chosen is the number selected (repeats permitted). There are no optional arguments/defaults; Calligra 26.08.2 registers a distinct COMBINA function with exactly two arguments. The version-pinned source XML correctly documents COMBINA(total;chosen) and gives COMBINA(12;5)=4368 and COMBINA(5;5)=126. [E2]
Critical documentation warning: the currently served KDE HTML handbook COMBINA section instead displays COMBIN(total;chosen) and COMBIN examples, a copy/paste discrepancy. This guide intentionally uses the registered COMBINA name, pinned XML, and pinned C++ implementation, not the conflicting HTML text, to identify the syntax. Verify any corrections in future releases rather than silently copying the handbook’s erroneous examples. [E1, E2]
The same C++ wrapper explicitly returns errorNUM() when chosen < 0 or chosen > total. That second rule is stricter than pure stars-and-bars mathematics, where choosing more than the number of types is possible when repetition is allowed. For example, the mathematical value of three picks from two types is 4, but this pinned Calligra wrapper would reject (2;3). The official Excel COMBINA article also documents a number >= number_chosen input constraint. Treat these as function-domain rules, distinct from the mathematical counting formula. [E2, E4]
The handbook calls arguments positive and the XML declares Int. For portable, reproducible sheets, stick to integer data where 1 <= chosen <= total. Exact behaviour for 0, fractional, text or negative-total inputs is not native-verified in this review; don’t infer it from a single guard condition. [E2]
Source scope: current release checked 2026-10-12: KDE Calligra 26.08.2, released October 8, 2026. Source pinned to 72123cc643f6625351139e7df294544255a1056f. Native execution and OS-package verification were not performed. [E5]
Why this isn’t ordinary COMBIN
For n types and k selections with repeats, the mathematical formula is:
C(n+k-1, k) = (n+k-1)! / (k! Ă— (n-1)!)
With four flavours and three scoops, that means C(6,3)=20. The pinned C++ implementation first forms total + chosen - 1, then passes it with chosen to ValueCalc::combin—matching this counting rule within the function’s accepted input domain. [E2, E3]
Reproduce it: mix-and-match products
Create a new sheet and put the following values in A2:B5; enter =COMBINA(A2;B2) in C2 and fill to C5. The outputs are independent mathematical expectations.
| Row | A: Types | B: Items picked | C: Formula | Expected combinations with repetition |
|---|---|---|---|---|
| 2 | 4 | 3 | =COMBINA(A2;B2) |
20 |
| 3 | 6 | 2 | =COMBINA(A3;B3) |
21 |
| 4 | 5 | 5 | =COMBINA(A4;B4) |
126 |
| 5 | 12 | 5 | =COMBINA(A5;B5) |
4368 |
For row 3, the 21 results comprise six pairs of the same type and fifteen pairs of different types: 6 + C(6,2) = 6 + 15 = 21. That makes the calculation easy to audit manually. For row 4, selecting five objects from five types with repeats yields many more than the single no-repeat group from COMBIN(5;5).
Step-by-step difference table
If you enter 4 in E2 and 3 in F2, use =COMBIN(E2;F2) in G2 and =COMBINA(E2;F2) in H2. The expected outputs are 4 and 20, respectively. Interpret G2 as “three distinct flavour types,” but H2 as “three scoops, flavours may repeat.” [E3]
Advanced application: inventory kit variants
Suppose a kit has two identical accessory slots and you can choose from six colours, with both slots allowed to be the same colour. Assign colours to A2=6 and slots to B2=2. =COMBINA(A2;B2) has expected result 21: fifteen mixed-colour kits plus six single-colour pairs. If the two slots are distinguishable (e.g. left and right) and blue/red differs from red/blue, use PERMUTATIONA(6;2), expected 36, not COMBINA.
This is an enumeration calculation. It does not tell you how much inventory to stock, which choices are popular, or whether every kit variant is legal under product constraints. Explicit business constraints need their own filtering or counting logic.
Errors, scope limits and troubleshooting
chosen > total: although repetition is permitted mathematically, the pinned C++ function checks and returnserrorNUM()for this condition.COMBINA(2;3)is thus source-predicted to error, not native-observed. [E2]chosen < 0: source also returnserrorNUM(). [E2]- The handbook seems to recommend
COMBIN: this is the identifiedCOMBINAHTML section typo. Use the correctly registeredCOMBINAfunction; don’t change the name to copy the broken handbook example. [E1, E2] - Non-integer/negative total/zero arguments: XML labels both parameters
Int, but the C++ wrapper is not enough to settle conversion or edge cases in all packages. Restrict published examples to the safe positive domain, and test edge cases in your installed application. - Unexpected number of results: check whether order matters;
COMBIN,COMBINA,PERMUTandPERMUTATIONAeach count a different model. - Locale and formula entry: the KDE English example uses a semicolon between arguments. Adapt separators/decimal notation to your installed language and formula settings; do not mistake
,in a translated screenshot for a universally valid formula separator. - Very large calculations: results can exceed exactly representable numeric ranges or available formatting width. This review did not characterize implementation overflow/precision cutoffs.
Excel and other spreadsheet compatibility
Microsoft’s Excel COMBINA documentation uses the same with-repetition interpretation, and its official examples include COMBINA(4,3)=20. However, Excel documents truncation for fractional inputs and specific #NUM!/#VALUE! rules. Those must not be attributed to Calligra without native testing. In addition, Excel’s English documentation displays comma argument separators, whereas KDE’s English handbook uses semicolons. The KDE HTML example is erroneous for this function, making version-specific review especially important. [E1, E2, E4]
Related functions and checked links
COMBIN counts unordered no-repeat selections; PERMUT counts ordered no-repeat selections; PERMUTATIONA counts ordered with-repeat sequences. These are separate, registered functions, not alternate names of COMBINA. See the KDE function reference, checked 2026-10-12, and Microsoft’s COMBINA reference.
Evidence and reproducibility
[E1] KDE HTML COMBINA section, accessed 2026-10-12: its visible COMBIN syntax/examples are inconsistent with the registered function. [E2] Pinned KDE statistical.xml lines 194–211 and statistical.cpp lines 1021–1029, inspected 2026-10-12: true syntax, expected examples, input guards and combinatorial implementation. [E3] Independent exact integer counts using the inputs shown above; never reported as native-observed. [E4] Microsoft Excel COMBINA reference, accessed 2026-10-12. [E5] KDE release listing, checked 2026-10-12. Validation: Documentation and version-pinned source reviewed; examples independently calculated. Native Calligra execution was not performed.