+ Reply to Thread
Results 1 to 8 of 8

Macro computing average and Q1 and Q3 of raw data

  1. #1
    Registered User
    Join Date
    06-22-2012
    Location
    Austin
    MS-Off Ver
    Excel 2010
    Posts
    35

    Macro computing average and Q1 and Q3 of raw data

    Hello all,

    I have two columns of data. The first is corresponding to the day of the month (1-30) and the second the corresponding rainfall. I would like to find the average rainfall and Q1 and Q3 for every 1st day of the month, 2nd, etc...

    Is there a way for a macro to recognize the number in the cell of the first column and then compute the values for all my data (approximately 5000 points) not in order and not the same amount for all days.

    Thanks

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,047

    Re: Macro computing average and Q1 and Q3 of raw data

    Not sure you need VBA (macro) for this, you can probably do it with a table of dates and averageifS()

    Upload a small sample workbook, and I will see what we can put together
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Registered User
    Join Date
    06-22-2012
    Location
    Austin
    MS-Off Ver
    Excel 2010
    Posts
    35

    Re: Macro computing average and Q1 and Q3 of raw data

    Here is a sample

    rainfall.xlsx

    Thanks again!
    Attached Files Attached Files

  4. #4
    Forum Expert Alf's Avatar
    Join Date
    03-13-2004
    Location
    Gothenburg/Mullsjoe, Sweden
    MS-Off Ver
    Excel 2019 and not sure I like it
    Posts
    4,784

    Re: Macro computing average and Q1 and Q3 of raw data

    Perhaps like this then?
    Attached Files Attached Files

  5. #5
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,229

    Re: Macro computing average and Q1 and Q3 of raw data

    Hi Settler,

    A Pivot Table might do exactly what you need without needing any VBA. See the attached.
    Attached Files Attached Files
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  6. #6
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,047

    Re: Macro computing average and Q1 and Q3 of raw data

    If I understand you correctly...
    =AVERAGEIF($A$2:$A$14,1,$B$2:$B$14)
    Not sure what you mean by Q1 and Q2 though?

  7. #7
    Registered User
    Join Date
    06-22-2012
    Location
    Austin
    MS-Off Ver
    Excel 2010
    Posts
    35

    Re: Macro computing average and Q1 and Q3 of raw data

    Thanks!!! Solved!

  8. #8
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,047

    Re: Macro computing average and Q1 and Q3 of raw data

    Out of interest, who solved it for you?

+ 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. drop top and bottom values before computing average
    By jimboryan in forum Excel General
    Replies: 2
    Last Post: 07-15-2014, 04:04 PM
  2. computing for scores (average)
    By drcbedana in forum Excel General
    Replies: 1
    Last Post: 12-30-2010, 07:24 AM
  3. Computing Average
    By jagannathkiran in forum Excel General
    Replies: 4
    Last Post: 06-28-2010, 06:59 AM
  4. computing weekly average
    By j_blocker in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-01-2007, 12:43 AM
  5. "Drop the lowest" in computing average
    By Matthew Leingang in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 09-06-2005, 06:05 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