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

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
Acos() and Radians() aren't VBA functions, but you can call the Excel functions from VBA.
 
Upvote 0

Forum statistics

Threads
1,224,825
Messages
6,181,189
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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