Results 1 to 4 of 4

How to AVERAGE using arrays in VBA (No cell references)

Threaded View

PercivalP How to AVERAGE using arrays... 08-27-2022, 07:50 PM
protonLeah Re: How to AVERAGE using... 08-27-2022, 10:29 PM
jindon Re: How to AVERAGE using... 08-27-2022, 11:03 PM
PercivalP Re: How to AVERAGE using... 08-28-2022, 07:43 AM
  1. #1
    Registered User
    Join Date
    11-02-2018
    Location
    Wolverhampton
    MS-Off Ver
    2015 (Mac) 15.12.3
    Posts
    17

    How to AVERAGE using arrays in VBA (No cell references)

    Hi forum,

    I'd like to calculate an average of the last n values in an array. I plan on creating a loop for n but to keep things simple, let's just say n = 10.

    I would like to calculate an average of the last 10 values in a list. I have written the column to an array and i'd like to use that within VBA, using cell references will take a VERY long time with how many values i'll need to create, especially with a loop for n.

    I can not get my head around how I would achieve this so any help is greatly appreciated.

    I have created and attached a workbook which shows what i'm trying to do.

    Kind regards,
    PercivalP.
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Efficient VBA method for looking up cell values - dynamic sheet references and arrays
    By phor89 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-24-2021, 01:04 PM
  2. Replies: 5
    Last Post: 11-12-2018, 10:24 PM
  3. storing multiple value in a single cell (through arrays or without arrays)?
    By mak51061 in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 12-25-2014, 09:27 PM
  4. [SOLVED] Grab 3 cells to left of the cell I need to average without updating references
    By shane01101 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-13-2014, 10:33 AM
  5. VBA store references with arrays
    By fuatt in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-25-2013, 07:57 AM
  6. lookup arrays - relative references?
    By jmhultin in forum Excel General
    Replies: 2
    Last Post: 08-09-2009, 07:11 PM
  7. Arrays and range references in VBA
    By Stewart in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 08-22-2005, 01:05 PM

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