IMCOS function
Returns the cosine of a complex number. For z = x+yi it equals cos x·cosh y − i·sin x·sinh y.
Available in Excel 2007 and later (Excel 2003 needed the Analysis ToolPak add-in), Microsoft 365, Excel for the web, Excel for Mac
Excel 2007 and laterWorks in Google Sheets
Syntax
IMCOS(inumber)| Argument | What it means | |
|---|---|---|
inumber | Required | A complex number as text such as "3+4i" or "5-2j", a cell containing one, or a plain number. Build it with COMPLEX to avoid typing errors. |
Returns: A complex number as text.
How IMCOS works
IMCOS returns the cosine of a complex number: cos(x + yi) = cos x·cosh y − i·sin x·sinh y. On the real axis it matches COS; off the axis it grows quickly because of the hyperbolic factors. Like all IM functions, it reads complex numbers written as text (x+yi or x+yj) and returns its answer as text with up to 15 significant digits, so you can feed the result straight into another IM function.
Complex trigonometric and hyperbolic functions are mostly used in electrical engineering (transmission lines, filters), control theory and physics. For everyday spreadsheets you will rarely need them, but they make it possible to keep a whole calculation in Excel instead of switching to a maths package.
Examples
1Evaluate at the imaginary unit i
| A | B | |
|---|---|---|
| 1 | Complex number | |
| 2 | i | 1.54308063481524 |
Result: 1.54308063481524
cos(i) = cosh(1) ≈ 1.5431, a real number greater than 1 — impossible for a real cosine.
2Cosine of 1+i
| A | B | |
|---|---|---|
| 1 | Complex | |
| 2 | 1+i | 0.833730025131149-0.988897705762865i |
Result: 0.833730025131149-0.988897705762865i
cos 1·cosh 1 = 0.5403 × 1.5431 ≈ 0.8337 and −sin 1·sinh 1 = −0.8415 × 1.1752 ≈ −0.9889.
Common errors and how to fix them
| Error | Why it happens | Fix |
|---|---|---|
#NUM! | The text is not a valid complex number — for example it contains spaces (3 + 4i), a capital I, or a misplaced sign. | Create the value with COMPLEX or remove spaces with SUBSTITUTE. |
#VALUE! | The argument is a logical value, or the formula mixes the i and j suffixes. | Use one suffix consistently throughout a calculation. |
Tips
Google Sheets
IMCOS also exists in Google Sheets and works the same way for everyday use, so the examples above work there too.
IMCOS in other languages
In a non-English version of Excel the function has a local name. Excel translates formulas automatically when a file is opened in another language.
| Language | Function name |
|---|---|
| Danish | IMAGCOS |
| Dutch | C.COS |
| Finnish | KOMPLEKSI.COS |
| French | COMPLEXE.COS |
| Hungarian | KÉPZ.COS |
| Italian | COMP.COS |
| Polish | COS.LICZBY.ZESP |
| Russian | МНИМ.COS |
| Spanish | IM.COS |
| Turkish | SANCOS |