+ Reply to Thread
Results 1 to 4 of 4

Macro needed for Average/Sum formulas in 2 columns

  1. #1
    Registered User
    Join Date
    02-27-2013
    Location
    Columbus, OH
    MS-Off Ver
    Excel 2010
    Posts
    2

    Thumbs up Macro needed for Average/Sum formulas in 2 columns

    I apologize if this is a simple question, I am very new to Excel VBA macros. Nothing of my basic knowledge has found a solution, so I figured I'd reach out for suggestions.

    I am trying to automate a tedious process of selecting a section of numbers (2 columns) following a specific string, and then in the next 2 free columns applying 2 separate formulas to each selection.

    for example:
    2 Columns, B & C

    Column B is labeled blks/s per section. I'd select all of the numbers in the section (usually manually holding shift-down) and then apply the formula =sum(B3:B99) for example. In the same column, I'd find blks/s again followed by more numbers (repeating the previous process).

    Column C is similar except I'd go by sections for avserv and apply the formula =average(C3:C99) for example.

    These are repeated until I reach the end of the columns.

    I want to capture the formula values for Column B in Column D. And the values for Column C to Column E.

    Please let me know if I need to clarify any further. This would be of great assistance!
    Attached Files Attached Files
    Last edited by denny2468; 02-27-2013 at 04:13 PM. Reason: Solution provided. Thank you!

  2. #2
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Macro needed for Average/Sum formulas in 2 columns

    1) with an formula in a2 (yellow cell)

    2) a macro to delete the empty cells in column B

    3) and an pivot table, i come to this result.

    See the attached file.
    Attached Files Attached Files
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  3. #3
    Registered User
    Join Date
    02-27-2013
    Location
    Columbus, OH
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Macro needed for Average/Sum formulas in 2 columns

    Absolutely amazing! Thank you kindly! Works perfect.

  4. #4
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Macro needed for Average/Sum formulas in 2 columns

    Thanks for the reply.

    Glad I could help.

    If your question is solved, will you mark the the question as solved.

    Do you have (other) questions on this item, just ask or comment.

    You can add points to the rep(utation) of the forummember who helped you, by clicking on the star on the left side.

+ 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