+ Reply to Thread
Results 1 to 8 of 8

Ask: creating the macro to delete half of data and calculate average of the first six row

  1. #1
    Registered User
    Join Date
    12-01-2012
    Location
    Finland
    MS-Off Ver
    Excel 2010
    Posts
    3

    Question Ask: creating the macro to delete half of data and calculate average of the first six row

    Hi,

    I have a problem with an assignment. I want to delete gradually one row from the column, from down to up. If the number of rows in 1st column is n, the number of rows in 2nd column is n-1, rows in 3rd column is n-2 , etc. So the table after being deleted will have a triangle shape.

    Then I want to take first 6 rows from down in every column to calculate the average.

    I attached my work. Can you give me any solutions? I have been stucked with it

    Thanks,

    macro ex1 - Copy.xlsm

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

    Re: Ask: creating the macro to delete half of data and calculate average of the first six

    Hi tomama88,

    This will get your triangle - I don't understand what you want to do with the averages:

    Please Login or Register  to view this content.
    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

  3. #3
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,520

    Re: Ask: creating the macro to delete half of data and calculate average of the first six

    another way

    Please Login or Register  to view this content.
    Last edited by mike7952; 12-01-2012 at 09:43 PM.
    Thanks,
    Mike

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved.

  4. #4
    Registered User
    Join Date
    12-01-2012
    Location
    Finland
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Ask: creating the macro to delete half of data and calculate average of the first six

    Hi,

    After having 'triangle table', I want to calculate the average of six rows from down in every column. For example,
    A25 is the average of A18:A23
    B25 is the average of B17:B22
    C25 is the average of C16:C21
    etc.

    Thanks in advance. I am trying with the macro 'triangle'
    Attached Files Attached Files

  5. #5
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,520

    Re: Ask: creating the macro to delete half of data and calculate average of the first six

    Try this

    Please Login or Register  to view this content.
    Last edited by mike7952; 12-01-2012 at 10:18 PM.

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

    Re: Ask: creating the macro to delete half of data and calculate average of the first six

    Well - if the columns exceed the rows, how do you want to handle it??

    Here it is without the aforementioned issue:

    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    12-01-2012
    Location
    Finland
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Ask: creating the macro to delete half of data and calculate average of the first six

    Thanks. I am beginner of coding macro. These codes are too high for me. but I will try to apply it.
    I myself tried by recording macro and did some changes, for examples:'
    Please Login or Register  to view this content.
    Firstly, I press Ctrl+r to cut , then ctrl+t to delete the remaining down, then ctrl+w to paste the average.

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

    Re: Ask: creating the macro to delete half of data and calculate average of the first six

    I've edited my routine a little:

    Please Login or Register  to view this content.

+ 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