The IMCOS function in Google Sheets is **useful when you would like to retrieve the cosine of a specified complex number.**

Since imaginary numbers are often difficult to compute with regular mathematical functions, we need specialized functions like IMCOS to deal with input in the form a + bi or a + bj.

##### Table of Contents

The rules for using the `IMCOS`

function in Google Sheets are as follows:

- The function requires a complex number as its input.
- The function then outputs the cosine of the given complex number.
- The cosine of a complex number is calculated by using the following equation:
*cos(x + yi) = cos(x) cosh(y) – sin(x) sinh(y)i*.

Let’s explore how we can use this function with a quick example!

In this example, we have a sample dataset of complex numbers found in column A. Complex numbers have a mathematical property that allows us to apply trigonometric functions. This includes finding the “theta” or angle of a complex number, or retrieving the sine and cosine of a complex number. Using the `IMCOS`

function, we’re able to return the cosine of each complex number in the dataset.

Now that we know when to use the `IMCOS`

function, let’s dive into how to use it and work on an actual sample spreadsheet.

**The Anatomy of the IMCOS Function**

So the syntax (the way we write) the `IMCOS`

function is as follows:

=IMCOS(number)

Let’s dissect this thing and understand what each of these terms means:

**=**the equal sign is how we start any function in Google Sheets.**IMCOS()**is our`IMCOS`

function. It computes the cosine of a given complex number.**number**refers to the given complex number which we would like to find the cosine of. It comes in the*a+bi*or*a+bj*format.

**A Real Example of Using IMCOS Function**

Let’s take a look at an example of the `IMCOS`

function being used in a Google Sheet spreadsheet.

In the table below, we have a dataset with ten complex numbers. We also have another column that outputs the cosine of each complex number.

To get the values in Column B, we just need to use the following formula:

=IMCOS(A2)

You can make a copy of the spreadsheet above using the link I have attached below.

If you think you’re ready to try out the `IMCOS`

function in Google Sheets, let’s start learning how to write it ourselves!

**How to Use IMCOS Function in Google Sheets**

- First thing we need to do is to prepare our input. In the picture below, we have our complex numbers in Column A of our worksheet.

- To start using the
`IMCOS`

function, first select the cell we will first put our function’s output. In this example, we’ll start with cell**B2.** - Next, we just have to type the equal sign ‘
**=**‘ to begin the function, followed by ‘**IMCOS(**‘. - As seen below, a tooltip box appears with info on the
`IMCOS`

function. We can click on the arrow on the top-right-hand corner of the box to minimize it if necessary.

- The next step is to type in the cell which has our complex number. In the first row, we can find our input in cell
**A2**.

Afterward, simply hit**Enter**on your keyboard to let the function return the cosine.

- Finally, we can copy the formula to fill out the rest of the column. Drag down the formula by dragging down the blue square in the bottom right corner of the selected
**B2**cell.

**Frequently Asked Questions (FAQ)**

**1. Why does my formula output a #NUM! error?**

A #NUM! error indicates that the given arguments are invalid and prevents the calculation from evaluating. For the `IMCOS`

function, the formula returns a #NUM! error if the complex number doesn’t have a lower case i or j as their variable for the imaginary coefficient. For example, “5+3x” is not a valid complex number but “5+3i” is acceptable.

**2. How do I make sure that my number argument is always a valid complex number?****
**To make sure that the input of the

`IMCOS`

is always valid, we can use the `COMPLEX`

function to generate our complex numbers. For example, we can use the formula `=COMPLEX(2, 3, ”i”)`

to create the complex number ‘2 + 3i’That’s all you need to know on how to use the `IMCOS`

function in Google Sheets. After going through this step-by-step guide, you should now know how to use the `IMCOS`

function in Google Sheets. It will come in handy whenever you need to find cosine values of complex numbers.

You can now use the `IMCOS`

functions in Google Sheets together with the various other Google Sheets formulas available to create excellent worksheets.

Stay notified of new Google Sheets guides like this by subscribing to our newsletter!