LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
rexmorgan
 
Posts: n/a
Default Average Wind Direction


I am attempting to create a custom function using other functions in
EXCEL. I am attempting to take an array of data (range of cells)
perform a few calculations and return the results. The function will be
stored in the appropriate workbook.

Here is the Code

Function AvgWndDir(cellrange)
Radianz = WorksheetFunction.Radians(cellrange)
' Convert from degrees to Radians
SINZ = WorksheetFunction.Sin(Radianz)
' Take the SIN of the Radians
AVGS = WorksheetFunction.Average(SINZ)
'Average the Sines
INVSIN = WorksheetFunction.Asin(AVGS)
' Take the inverse SIN of Average
DEG = WorksheetFunction.Degrees(INVSIN)
' Convert back to degrees from Radians
ROUNDED = WorksheetFunction.MROUND(DEG, 5)
' Round to nearest five degrees
End Function

Any help would be greatly appreciated. :(


--
rexmorgan
------------------------------------------------------------------------
rexmorgan's Profile: http://www.excelforum.com/member.php...o&userid=28167
View this thread: http://www.excelforum.com/showthread...hreadid=476925

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I average wind directions using excel? Rex Morgan Excel Discussion (Misc queries) 2 October 13th 05 05:22 PM
correcting wind direction data big eye Excel Discussion (Misc queries) 3 August 6th 05 12:11 AM
Average wind direction Phil Excel Discussion (Misc queries) 12 July 26th 05 12:02 PM
wind direction TC Excel Discussion (Misc queries) 3 July 14th 05 06:23 PM
how do i plot a rose diagram to show frequency of wind direction kathryn Charts and Charting in Excel 1 March 15th 05 09:42 PM


All times are GMT +1. The time now is 06:08 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"