Radians in UDF

Rumpkin

Board Regular
Joined
Sep 24, 2016
Messages
75
Office Version
  1. 2019
Platform
  1. Windows
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]
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
Acos() and Radians() aren't VBA functions, but you can call the Excel functions from VBA.
 
Upvote 0

Forum statistics

Threads
1,215,063
Messages
6,122,927
Members
449,094
Latest member
teemeren

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top