ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Calculating Averages (https://www.excelbanter.com/excel-programming/331137-calculating-averages.html)

Dani

Calculating Averages
 

Hi,

I'm working at calculating an average from a range of cells. The rang
is in another excel file, and is selected from user inputs.

This is what i have so far:

Workbooks.Open Filename:=file_name
Initial = "b" & w_row
Final = "b" & counter
range(Initial & ":" & Final).Select

This is where I get stuck...do i need to store these values in an arra
or is there a formula to calculate the average of range(Initial & ":"
Final)

Thanks in advance,
Dan

--
Dan
-----------------------------------------------------------------------
Dani's Profile: http://www.excelforum.com/member.php...fo&userid=2354
View this thread: http://www.excelforum.com/showthread.php?threadid=37706


Tom Ogilvy

Calculating Averages
 
Dim v as Double
Workbooks.Open Filename:=file_name
Initial = "b" & w_row
Final = "b" & counter
v = Application.Average(range(Initial & ":" & Final).Value)
msgbox v
' or
cells(1,1).Value = v

--
Regards,
Tom Ogilvy


"Dani" wrote in message
...

Hi,

I'm working at calculating an average from a range of cells. The range
is in another excel file, and is selected from user inputs.

This is what i have so far:

Workbooks.Open Filename:=file_name
Initial = "b" & w_row
Final = "b" & counter
range(Initial & ":" & Final).Select

This is where I get stuck...do i need to store these values in an array
or is there a formula to calculate the average of range(Initial & ":" &
Final)

Thanks in advance,
Dani


--
Dani
------------------------------------------------------------------------
Dani's Profile:

http://www.excelforum.com/member.php...o&userid=23542
View this thread: http://www.excelforum.com/showthread...hreadid=377068





All times are GMT +1. The time now is 02:26 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com