Practice free

IMSEC function

IMSEC returns the secant of a complex number as text in complex number form. To get a plain number, wrap the result in IMREAL or IMAGINARY.

Example

Read it as a sentence: find the secant of the complex number 1+i, then keep only its real part, which gives 0.498337030555187.

Practice this in the app

Syntax

IMSEC(inumber)

inumber (required)
A complex number as text, like "3+4i".

Returns: The result as a complex number in text form.

What Excel actually returns

Each formula below was run in desktop Excel. The result is exactly what the cell showed, errors included.

FormulaExcel showsCase
=IMSEC("3+4i") -0.0362534969158689+0.00516434460775318i "3+4i"
=IMSEC("3+4j") -0.0362534969158689+0.00516434460775318j Suffix j
=IMSEC(5) 3.52532008581609 Pure real number 5
=IMSEC("5") 3.52532008581609 Pure real text "5"
=IMSEC("i") 0.648054273663885 Pure imaginary "i"
=IMSEC("-2i") 0.26580222883408 "-2i"
=IMSEC("3+4I") #NUM! Uppercase I
=IMSEC("abc") #NUM! Invalid text

Watch out for

  • Result is text; wrap in IMREAL or IMAGINARY to get a number.

Where it works

Excel
IMSEC arrived in Excel 2013. Older versions do not have it.
Google Sheets
Same name, same behaviour for everyday use.

Part of Engineering functions. Every result on this page was measured in desktop Excel, build 16.0.20527. Last updated .