Calculating more than one value in a function

C

Charlie Johnson

Hi all,

Can something like this be done: Cos(A1:A10)? That is calculate the value
of Cos(A1) through Cos(A10). If so, how? I keep gettting an error.

Lurch
 
P

Peo Sjoblom

The trick is to first select for instance B1:B10, then in the formula bar
put your formula and enter it
with ctrl + shift & enter
 
B

Bernie Deitrick

Charlie,

In cell B1, you can simply enter
=Cos(A1)
and then copy down to B10.

Otherwise, you could select B1:B10, type =Cos(A1) and press
Ctrl-Enter.

Or, your could select B1:B10, type =Cos(A1:A10) and press
Ctrl-Shift-Enter.

If you want to use all the Cosine values in one cell, you could (for
example) sum them using
=SUM(Cos(A1:A10))
entered with Ctrl-Shift-Enter.

A better explanation of what you are doing would help us help you.

HTH,
Bernie
MS Excel MVP
 
C

Charlie Johnson

Charlie Johnson said:
Hi all,

Can something like this be done: Cos(A1:A10)? That is calculate the value
of Cos(A1) through Cos(A10). If so, how? I keep gettting an error.

Lurch
Also,

When I try to compute the cos(pi()/2) , I keep getting 6.12574E-17. Does
that mean 0? I know from computer programming that something that small is
essentially 0. Is that how Excel represents 0? If so, I would have thought
MS could have programmed that into Excel.

Lurch
 
D

Dave Peterson

It's a problem with any program that represents numbers in base 2.

This is a number very close to 0.
0.0000000000000000612574


You could wrap your formula with =round() (or one of its sibling functions) to
get as close as you wanted

=ROUND(COS(PI()/2),5)

will round to 5 decimal places.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top