+ Reply to Thread
Results 1 to 6 of 6

Macro to calculate the average

  1. #1
    Registered User
    Join Date
    06-23-2015
    Location
    Stockholm, Sweden
    MS-Off Ver
    2010
    Posts
    25

    Question Macro to calculate the average

    Hello,
    I need help create a macro that calculates the averages for each sequence of numbers as shown in the picture. I know this could be done using a formula, but in my case it is a little bit slow since I can easily have 100 groups of numbers similar to those in the picture. The percentage below the numbers is irrelevant in this case.
    Thank you for any help
    example.JPG

  2. #2
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,767

    Re: Macro to calculate the average

    Attach a sample workbook. Make sure there is just enough data to make it clear what is needed. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are demonstrated, mock them up manually if needed. Remember to desensitize the data.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  3. #3
    Registered User
    Join Date
    06-23-2015
    Location
    Stockholm, Sweden
    MS-Off Ver
    2010
    Posts
    25

    Re: Macro to calculate the average

    Okay, I attached a sample
    Attached Files Attached Files

  4. #4
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,767

    Re: Macro to calculate the average

    How to install your new code
    1. Copy the Excel VBA code
    2. Select the workbook in which you want to store the Excel VBA code
    3. Press Alt+F11 to open the Visual Basic Editor
    4. Choose Insert > Module
    5. Edit > Paste the macro into the module that appeared
    6. Close the VBEditor
    7. Save your workbook (Excel 2007+ select a macro-enabled file format, like *.xlsm)

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    06-23-2015
    Location
    Stockholm, Sweden
    MS-Off Ver
    2010
    Posts
    25

    Re: Macro to calculate the average

    Quote Originally Posted by :) Sixthsense :) View Post
    How to install your new code
    1. Copy the Excel VBA code
    2. Select the workbook in which you want to store the Excel VBA code
    3. Press Alt+F11 to open the Visual Basic Editor
    4. Choose Insert > Module
    5. Edit > Paste the macro into the module that appeared
    6. Close the VBEditor
    7. Save your workbook (Excel 2007+ select a macro-enabled file format, like *.xlsm)

    Please Login or Register  to view this content.

    I am amazed! It works perfectly! How would you edit the code so that it does the trick, but on column "I" instead?
    Thank you so much!

  6. #6
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,767

    Re: Macro to calculate the average

    Quote Originally Posted by ediman16 View Post
    How would you edit the code so that it does the trick, but on column "I" instead?
    Thank you so much!
    Change "A:A" to "I:I"

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Use the AVERAGE() function to calculate a sample average
    By alice2011 in forum Excel General
    Replies: 1
    Last Post: 09-24-2014, 08:04 AM
  2. Macro to Calculate Average, Stdev, Sum, and Count From a Column of Data That Changes
    By papuanewguinea in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-14-2013, 01:45 PM
  3. [SOLVED] Macro to calculate average and transfer the result to another WorkBook
    By khatibcell in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-17-2013, 03:19 AM
  4. VBA Macro to Calculate Average excluding Duplicates
    By dani_n88 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-04-2012, 07:55 PM
  5. [SOLVED] Ask: creating the macro to delete half of data and calculate average of the first six row
    By tomama88 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 12-02-2012, 03:14 PM
  6. Macro to calculate and display the average
    By suryab in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-22-2011, 06:14 PM
  7. Calculate average withouot incorporating sub average
    By ybu1106 in forum Excel General
    Replies: 25
    Last Post: 06-15-2010, 09:47 AM

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