Radians in UDF

Rumpkin

Board Regular
Joined
Sep 24, 2016
Messages
50
Hello,
Please review this formula to see why it does not work as a UDF.
It will work in the spreadsheet by either referencing cells that contain the degrees or by hard entering the degrees. Purpose is to find the cosine of the product of the cosine of two angels.
Code:
[TABLE="width: 80"]
<colgroup><col style="width:60pt" width="80"> </colgroup><tbody>[TR]
   [TD="width: 80"]Function TRUEBEND(SIDE_BEND, VERT_BEND)[/TD]
  [/TR]
  [TR]
   [TD]TRUEBEND = Application.WorksheetFunction.Round(Acos(Cos(Radians(SIDE_BEND)) * Cos(Radians(VERT_BEND))) / Radians(1), 2)[/TD]
  [/TR]
  [TR]
   [TD]End Function
[/TD]
  [/TR]
 </tbody>[/TABLE]
 

Some videos you may like

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce

StephenCrump

Well-known Member
Joined
Sep 18, 2013
Messages
3,769
Office Version
365
Platform
Windows
Acos() and Radians() aren't VBA functions, but you can call the Excel functions from VBA.
 

Watch MrExcel Video

Forum statistics

Threads
1,100,209
Messages
5,473,165
Members
406,849
Latest member
gustavor0

This Week's Hot Topics

Top