+ Reply to Thread
Results 1 to 2 of 2

Need help with simple excel macro to take sums and averages

  1. #1
    Registered User
    Join Date
    04-05-2019
    Location
    Dayton, Ohio
    MS-Off Ver
    2018
    Posts
    3

    Need help with simple excel macro to take sums and averages

    Hey,

    I am new to excel and need help creating a macro to do a simple task.

    First, I would like excel to take the sum of the cells in B2:B1441 and place that sum in cell J2
    I would like it to then take the sum of the cells in B1442:B2881 and place that sum in cell J3
    And continue this trend up until we take the sum of B420542:B421981 and place that in cell J294

    Following that, I would like to do the same thing for column C
    For example, take the sum of the cells in C2:C1441 and place that sum in cell K2
    Up until the point where the sum of cells C420542:C421981 and place that in cell K294

    I would like to repeat that for columns up until column G
    Where for example the sum of the cells G2:G1441 would be placed in Cell O2
    Up until the point where the sum of cells G420542:G421981 and place that in cell O294


    After that, I would like to do the same function, but taking the averages of the columns instead of the sums.

    For example, I would take the average of cells B2:B1441 and place that in cell R2
    And continue this trend up until we take the average of B420542:B421981 and place that in cell R294

    I would like to continue this trend for the same columns (B-G) placing them in the corresponding cells
    For example, I would continue until we take the average of G2:G1441 would be placed in Cell W2
    Up until we take the average of cells G420542:G421981 and place that in cell W294

    Thank you so much. Help is very much appreciated

  2. #2
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,003

    Re: Need help with simple excel macro to take sums and averages

    Attach a sample workbook (not a picture or pasted copy). Make sure there is just enough data to demonstrate your need. 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 shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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