IMCOS Function (LibreOffice Calc)
Learn the IMCOS function in LibreOffice Calc: Returns the cosine of a complex number.
Verification status: Selected examples were executed in LibreOffice Calc 25.2.3.2. This does not establish that every formula and edge case was tested. How formula examples are checked
Quick answer: what IMCOS does
IMCOS returns the cosine of a complex number such as "4-3i". Unlike regular COS, which operates on a real angle and returns a number, IMCOS returns a text string encoding the real and imaginary components. The complex cosine uses radians for the real angle component; its imaginary component is handled mathematically rather than by discarding it.
For z=a+bi, the mathematical definition is cos(z) = cos(a) cosh(b) - i sin(a) sinh(b). You do not need to compute that expression manually—IMCOS does it directly.
Syntax and arguments
=IMCOS(Complex_number)
Complex_number — Required. One complex-number expression, a reference to a cell containing it, a formula returning one, or a real numeric value. Complex numbers are represented as text such as "4-3i", "3+4j", or values created with COMPLEX.
IMCOS has one argument, not an optional second parameter. The real and imaginary coefficients use the suffix i or j. Numeric real-only arguments are permitted, although the function returns text. The English-US examples use a period as the decimal separator and semicolons between function arguments (only the nested COMPLEX and other multiargument formulas need separators); other locales or customized Calc formula separators may differ. Use Calc’s formula editor if an imported formula produces a separator error. LibreOffice’s official Help describes the complex-input text representation and textual output for complex trigonometric functions; the legacy analysis-function page covers IMSQRT.
Reproducible worked example
Enter the following cells as indicated (enter A2 as literal text, not a formula):
On a narrow screen, scroll this table sideways to see every column.
| Cell | Value | Type |
|---|---|---|
| A2 | 4-3i |
Text, complex input |
| B2 | 4 |
Number, real coefficient |
| C2 | -3 |
Number, imaginary coefficient |
In D2 enter:
=IMCOS(A2)
Expected and observed output (Calc 25.2.3.2): -6.58066304055116-7.58155274274654i. The real component is approximately -6.580663; the imaginary component is approximately -7.581553. This is a text result, not a conventional numerical cell value. The same output occurs with:
=IMCOS("4-3i")
For a real-only angle in radians:
=IMCOS(2)
Expected and observed: the text -0.416146836547142. A zero complex input gives:
=IMCOS("0+0i")
Expected and observed: 1 (as text). The imaginary zero part is omitted.
Advanced use: build the complex number from two data columns
Instead of manually constructing an a+bi string, use the numeric coefficients in B2 and C2:
=IMCOS(COMPLEX(B2;C2))
Expected and observed: -6.58066304055116-7.58155274274654i. COMPLEX(4;-3) constructs the input 4-3i, and IMCOS evaluates it. This is useful when real and imaginary coefficients are imported separately from instrumentation or modelling data.
For an independent identity check, complex cosine is even: cos(-z)=cos(z).
=IMSUB(IMCOS("1+2i");IMCOS("-1-2i"))
Expected and observed: 0. This specific Calc expression was tested; floating-point equality for arbitrary large or extreme values should not be assumed.
Errors, limitations, and troubleshooting
Err:502from invalid complex text:=IMCOS("not-a-number")and=IMCOS("")both producedErr:502in the native test. Check for an actualiorjsuffix, a correctly signed imaginary coefficient, and valid numeric text rather than an imported text label.- Looks numeric but will not add like an ordinary value: IMCOS returns a string even when the imaginary part is zero. Use
IMREAL(IMCOS(A2))if you need a real numeric coefficient for further calculations; use complex arithmetic functions such as IMSUM/IMPRODUCT for complex results. - Unexpected result:
COS(2)andIMCOS(2)represent the same mathematical real cosine, but the former is a numeric result and the latter is a complex-format string. The argument is in radians, not degrees. - Output says
iwhere you expectedj: Keep a consistent suffix in your source data; the formatting is part of the complex string representation, not a separate number format you can safely ignore. - Long decimals: Small numerical differences across implementations can arise from rounding and serialization. Display fewer decimal places for reporting rather than rounding a complex string directly.
Compatibility and version notes
- LibreOffice Calc: The official 26.8 Help function catalogue lists this function. Native formula execution below was performed on LibreOffice Calc 25.2.3.2 using the actual UNO spreadsheet engine, not by evaluating the expression in Python. The targeted Help page can display a different version banner in cached views; no function-introduction version is asserted without explicit release evidence.
- Excel: Microsoft’s current function inventory lists this function under Engineering. Formula argument separators and text formatting may differ with locale and software versions; no Excel formula was executed for this draft.
- Google Sheets: Google’s published function inventory also lists this function. Text serialization, locale separators, and very small rounding differences should be verified after import; no Google Sheets formula was executed.
- ODF: The LibreOffice function Help identifies these complex trigonometric functions as part of OpenDocument 1.2; the
IMSQRTanalysis-function reference supplies its syntax and example. Do not infer that every LibreOffice version or web/mobile implementation has been checked.
Related tutorials
The following target slugs and source files were confirmed in the archived 2026-10-10 owner-source bundle; a current live-site link check is still required before publishing:
Official evidence and testing disclosure
- LibreOffice Calc official function help — checked 2026-10-11; purpose, exact signature, input/output rules, and published examples.
- LibreOffice Calc Add-in/analysis functions — checked 2026-10-11; category listing and complex/IMSQRT functions.
- Microsoft Excel official function inventory — checked 2026-10-11; cross-software existence only.
- Google Sheets official function inventory — checked 2026-10-11; cross-software existence only.
How this guide was checked
Selected example formulas were run in LibreOffice Calc 25.2.3.2 on Linux on October 12, 2026. The official Help may cover a newer version. Tests of selected formulas do not certify every locale, interactive array operation or file round trip. View the example-check record.