IMCOSH Function in Excel

Sumit Bansal
Written by

Sumit Bansal is the founder of TrumpExcel.com and a 13-time Microsoft Excel MVP. He started this site in 2013 to share his passion for Excel through easy tutorials, tips, and training videos, helping you master Excel, boost productivity, and maybe even enjoy spreadsheets!

The IMCOSH function in Excel returns the hyperbolic cosine of a complex number, such as 2+3i or 1.5-0.5j. It’s one of Excel’s engineering functions, so you’ll mostly run into it in math, physics, and electrical work.

Like Excel’s other complex-number functions, IMCOSH reads the number as text and gives the answer back as text. So you can’t total its results with the SUM function or round them with the ROUND function the usual way.

In this article, I’ll show you five examples, including how to use IMCOSH on a whole column and how to round its long results.

Follow along with the example file

IMCOSH Function Examples.xlsx

Download

IMCOSH Function Syntax

Here is the syntax of the IMCOSH function:

=IMCOSH(inumber)
  • inumber – The complex number you want the hyperbolic cosine of.

The complex number is written as text in the x+yi or x+yj form. When you type it straight into the formula, put it in double quotes, so =IMCOSH("2+3i") returns -3.72454550491532+0.511822569987385i.

You can also give it a regular number. IMCOSH treats it as a complex number with no imaginary part, so =IMCOSH(2) returns 3.76219569108363.

If Excel can’t read the text as a complex number, IMCOSH returns the #NUM! error. A TRUE or FALSE value returns the #VALUE! error.

The IMCOSH function works in Excel for Microsoft 365, Excel 2024, 2021, 2019, 2016, and Excel for Mac.

When to Use the IMCOSH Function

Use this function when you need to:

  • Find the hyperbolic cosine of complex numbers in a math or engineering worksheet
  • Work with complex values written in j notation, such as in power line and AC circuit calculations
  • Check textbook or homework answers that involve the hyperbolic cosine of a complex number
  • Get the hyperbolic cosine when the real and imaginary parts sit in separate columns (by pairing it with the COMPLEX function)

Let me show you a few practical examples of how to use the IMCOSH function.

Example 1: Find the Hyperbolic Cosine of Complex Numbers

Let’s start with a simple example.

Below is a list of complex numbers, and I want to get the hyperbolic cosine of each one in column B.

Ten complex numbers in column A with an empty Hyperbolic Cosine column.

Here is the formula:

=IMCOSH(+A2:A11)
IMCOSH with a plus sign before the range in B2 spills the hyperbolic cosine of every complex number.

Enter this in cell B2, and it spills the results down to B11. For 2+3i, you get -3.72454550491532+0.511822569987385i, so the hyperbolic cosine of a complex number is also a complex number.

The plus sign in front of the range matters. IMCOSH can’t take a multi-cell range reference like A2:A11, so without the plus sign, the formula returns a #VALUE! error.

With the plus sign, Excel hands IMCOSH the values as an array (a list of values held in memory), and IMCOSH works through each one. The same trick works for other functions that won’t spill when you give them a range.

Also notice that the results sit on the left side of the cells. That’s because IMCOSH always returns text.

The real and imaginary parts also come with long decimals, and Example 4 shows how to round them.

Spilling needs Excel 365 or Excel 2021 or later. If you are using Excel 2019 or earlier, enter the below formula in cell B2 and then copy it down the range:

=IMCOSH(A2)

Example 2: IMCOSH vs COSH for Real Numbers

IMCOSH also works on numbers that have no imaginary part, but there’s a better function for those.

Below is a list of regular numbers, and I want to get the hyperbolic cosine of each one in column B.

A list of regular numbers with an empty IMCOSH Result column.

Here is the IMCOSH formula:

=IMCOSH(+A2:A11)
IMCOSH in B2 returns the hyperbolic cosine of each regular number as left-aligned text.

IMCOSH treats each number as a complex number with no imaginary part, so the results have no i in them. For example, 2 returns 3.76219569108363, and -2 returns the same value, because the hyperbolic cosine ignores the sign.

But these results are still text, which is why they’re left-aligned. If you try to total them with the SUM function, you get 0.

Now here is the COSH function for comparison. Enter this formula in cell C2:

=COSH(A2:A11)
COSH in C2 returns the same values as numbers beside the IMCOSH text results.

The COSH function takes the range directly (no plus sign needed) and returns the same values as real numbers. You can format, total, or reuse them like any other number.

Column C shows fewer decimals because of its General format, but the stored values match the IMCOSH results.

So when your numbers have no imaginary part, use the COSH function. Keep IMCOSH for numbers that do.

If you are using Excel 2019 or earlier, enter the below formula in cell B2 and then copy it down the range:

=IMCOSH(A2)

And for the COSH version, enter the below formula in cell C2 and then copy it down the range:

=COSH(A2)

Example 3: IMCOSH with Real and Imaginary Parts in Separate Columns

Sometimes the real and imaginary parts aren’t stored together as one complex number. Instead, they sit in two separate columns.

Below is a table with the real part of each number in column A and the imaginary part in column B, and I want to get the hyperbolic cosine of each complex number in column C.

Real parts in column A and imaginary parts in column B with an empty Hyperbolic Cosine column.

Here is the formula:

=IMCOSH(COMPLEX(+A2:A11,+B2:B11))
IMCOSH with COMPLEX in C2 joins each real and imaginary part and spills the hyperbolic cosine.

How this formula works:

  • COMPLEX(+A2:A11,+B2:B11) joins each real part with its imaginary part, so 1 and 2 become 1+2i. The COMPLEX function can’t take range references either, so both ranges get a plus sign.
  • IMCOSH then returns the hyperbolic cosine of each complex number, and the results spill down to C11.

Look at row 6, where the real part is 0. The result is -0.416146836547142, which is the regular cosine of 2 (the same value the COS function returns).

Now look at row 7, where the imaginary part is 0. You get 2.35240961524325, which is simply the hyperbolic cosine of 1.5.

This comes from how IMCOSH does the math. For a number x+yi, it calculates COSH(x)*COS(y) for the real part and SINH(x)*SIN(y) for the imaginary part.

When x is 0, COSH(x) is 1 and SINH(x) is 0, so only the cosine of y is left. And when y is 0, COS(y) is 1 and SIN(y) is 0, so you get just the hyperbolic cosine of x.

If you are using Excel 2019 or earlier, enter the below formula in cell C2 and then copy it down the range:

=IMCOSH(COMPLEX(A2,B2))

Example 4: Use IMCOSH with j Notation and Round the Result

Electrical engineers usually write complex numbers with j instead of i. IMCOSH handles both, and it keeps the same letter in the result.

A common place you’ll see this is a long power line. Every line has a propagation constant, written γ, which is a complex number made from the attenuation (how much the voltage weakens per mile) and the phase shift per mile.

With nothing connected at the far end, the voltage at the start equals the voltage at the end multiplied by cosh(γ × length).

Below is a list of power line lengths in miles, with the attenuation per mile in F2 and the phase shift per mile in F3, and I want to calculate cosh(γ × length) for each line in column B.

Power line lengths in miles with the attenuation and phase shift per mile in F2 and F3.

Here is the formula:

=IMCOSH(COMPLEX(F2*A2:A11,F3*A2:A11,"j"))
IMCOSH with COMPLEX in B2 spills cosh(γ × length) for each line in j notation.

How this formula works:

  • F2*A2:A11 multiplies the attenuation by each line length, and F3*A2:A11 does the same for the phase shift. Since the formula already does math on the range, the result is an array, so no plus sign is needed here.
  • COMPLEX(…,”j”) joins the two values into γ × length for each line, written with j.
  • IMCOSH returns the hyperbolic cosine of each one, again with j.

For the 500-mile line, the result is 0.544528916735435+0.105458003513954j. As the line gets longer, the size of this result (its magnitude) drops further below 1, to about 0.55 at 500 miles.

Since the start voltage equals the end voltage times this value, a value below 1 means the voltage at the far end is higher than at the start when nothing is connected.

These results are hard to read with all those decimals. You can’t fix that with the ROUND function directly, because the result is text and the ROUND function returns a #VALUE! error.

Instead, round the real and imaginary parts separately and join them back. Here is the formula to enter in cell C2:

=LET(a,IMCOSH(COMPLEX(F2*A2:A11,F3*A2:A11,"j")),COMPLEX(ROUND(IMREAL(a),4),ROUND(IMAGINARY(a),4),"j"))
LET with IMREAL, IMAGINARY, ROUND, and COMPLEX in C2 rounds each result to four decimals in j notation.

How this formula works:

  • IMCOSH(COMPLEX(…)) is the same formula as before, and the LET function stores its results as a, so IMCOSH runs only once.
  • IMREAL(a) and IMAGINARY(a) pull out the real and imaginary parts as regular numbers.
  • ROUND(…,4) rounds each part to four decimal places.
  • COMPLEX(…,”j”) joins the rounded parts back into a complex number with j.

Now the 500-mile line shows 0.5445+0.1055j. The COMPLEX function also drops trailing zeros, so the 100-mile line shows 0.9804+0.005j instead of 0.9804+0.0050j.

The LET function needs Excel 2021 or later. If you are using Excel 2019 or earlier, enter the below formula in cell B2 and then copy it down the range:

=IMCOSH(COMPLEX($F$2*A2,$F$3*A2,"j"))

And for the rounded result, enter the below formula in cell C2 and then copy it down the range:

=COMPLEX(ROUND(IMREAL(B2),4),ROUND(IMAGINARY(B2),4),"j")

Example 5: Why IMCOSH Returns the #NUM! Error

IMCOSH is picky about how a complex number is written. This example shows what goes wrong with messy entries and how to spot it.

Below is a practice sheet where students typed in complex numbers, and I want to get the hyperbolic cosine of each entry in column C.

Complex numbers typed by students, some in the wrong format and one left blank, with an empty Hyperbolic Cosine column.

Here is the formula:

=IMCOSH(+B2:B11)
IMCOSH in C2 returns #NUM! for four badly written entries and 1 for the blank entry.

Four entries return the #NUM! error, because IMCOSH can’t read them as complex numbers:

  • 3-2I (Thomas) uses an uppercase I. Only a lowercase i or j works.
  • (2+i) (Deborah) has parentheses around the number.
  • 4i-1 (Brett) puts the imaginary part first. The real part has to come first.
  • 1,5+2i (Arthur) uses a comma as the decimal point. With a period as your decimal separator, it needs to be 1.5+2i.

Fix the entry, and the error goes away. Spaces are fine, though, which is why Calvin’s 0.5 + 2.5i works.

Now look at Monica’s row. She left her entry blank, but IMCOSH returns 1 instead of an error.

That’s because IMCOSH treats an empty cell as 0, and the hyperbolic cosine of 0 is 1.

Important: Since a blank row looks just like a real answer, check for empty inputs before you use IMCOSH results in other calculations.

Here is the formula that skips the blank entries. Enter it in cell D2:

=IF(B2:B11="","",IMCOSH(+B2:B11))
IF with IMCOSH in D2 leaves the blank entry empty while the #NUM! errors stay visible.

The IF function checks each entry first. If it’s empty, the formula returns an empty string, and otherwise it calculates the hyperbolic cosine, so Monica’s row now stays blank.

The #NUM! errors are still there on purpose. Hiding them with the IFERROR function would also hide the entries that need fixing.

If you are using Excel 2019 or earlier, enter the below formula in cell D2 and then copy it down the range:

=IF(B2="","",IMCOSH(B2))

So these are some practical ways to use the IMCOSH function in Excel to get the hyperbolic cosine of complex numbers.

Just remember to use a lowercase i or j, and put a plus sign in front of a range when you want one formula for the whole column. I hope you found this article helpful.

List of All Excel Functions

Other Excel Articles You May Also Like:

Sumit Bansal

Sumit Bansal

13x Microsoft Excel MVP

Hey! I'm Sumit Bansal, founder of trumpexcel.com and a Microsoft Excel MVP. I started this site in 2013 because I genuinely love Microsoft Excel (yes, really!) and wanted to share that passion through easy Excel tutorials, tips, and Excel training videos. My goal is straightforward: help you master Excel skills so you can work smarter, boost productivity, and maybe even enjoy spreadsheets along the way!

Get the FREE 51 Excel Tips Ebook

Enter your details and the free PDF is on its way to your inbox.

Hmm, that didn't go through. Please check your email and try again.

No spam. You'll also get my weekly Excel newsletter. Unsubscribe anytime.

Check your inbox!

The ebook is on its way to your email. It usually lands within a couple of minutes.