Change worksheet radian default

  • Thread starter Thread starter Scrungie
  • Start date Start date
S

Scrungie

Is there an easy way to change the worksheet radian default to degrees
so that I don´t have to use the 180/PI or PI/180 or the degrees
function.

The following is a formula to derive the Log Haversine of the number
30,

Log((1-Cos(30*PI()/180)))/2)+10

and the following is to derive the number 30 from the Log Haversine,

(Acos(1-(10^((D18-10))*2))*180/PI())/24 D18 being the cell
with the log haversine.

Surely there is an easier way to get a log haversine than this. Any
help will be most appreciated.

Scrungie.
 
There's no way to change the default. However, you could use the
RADIANS() function:

=LOG((1-COS(RADIANS(30)))/2)+10

You could also use a UDF, which will be cleaner, though slower:

Public Function CosD(degrees As Double) As Double
Const dRad As Double = 0.0174532925199433
CosD = Cos(degrees * dRad)
End Function

call it as

=LOG((1-CosD(30))/2)+10

and of course, you could put it all in a UDF:

Public Function LogHaversine(degrees As Double) As Double
Const dRad As Double = 0.0174532925199433
LogHaversine = Log((1 - Cos(degrees * dRad)) / 2) / Log(10) + 10
End Function

if you're not familiar with UDFs see

http://www.mvps.org/dmcritchie/excel/getstarted.htm
 

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

Back
Top