+ Reply to Thread
Results 1 to 2 of 2

Calculating Averages

  1. #1
    Registered User
    Join Date
    05-19-2005
    Posts
    7

    Calculating Averages

    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

  2. #2
    Tom Ogilvy
    Guest

    Re: 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" <[email protected]> wrote in message
    news:[email protected]...
    >
    > 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
    >




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1