Home |
Search |
Today's Posts |
#1
![]() |
|||
|
|||
![]() 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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How do I average wind directions using excel? | Excel Discussion (Misc queries) | |||
correcting wind direction data | Excel Discussion (Misc queries) | |||
Average wind direction | Excel Discussion (Misc queries) | |||
wind direction | Excel Discussion (Misc queries) | |||
how do i plot a rose diagram to show frequency of wind direction | Charts and Charting in Excel |