+ Reply to Thread
Results 1 to 8 of 8

Using average with other formulas

  1. #1
    Registered User
    Join Date
    12-07-2012
    Location
    london, england
    MS-Off Ver
    Excel 2003
    Posts
    43

    Using average with other formulas

    Hi All,

    I have 2 columns - A & B, both range for approx 30,000 rows. Column A contains numbers, Col. B is a helper with 1 or 0. In column C,D,E,F - I want to calculate the average for each quartile (or 1st 25%, 2nd 25%, 3rd 25%, and 4th 25%) of cells in column A, but the range is from every time 1 appears in column B till the next 1 appears in column B (thus the range of each last quartile will be till the last zero before the next 1 appears in column B).

    To do a COUNTIF with similar conditions I use the following formula,
    IF(AND(U2=1,COUNTIF(U3:U$40000,1)),COUNTIF((L2:INDEX(L3:INDEX(L3:L40000,INT((MATCH(1,U3:U40000,0)-1)/4)),)),">0"),"")

    Can't get around finding the average. Please help!

    Thanks a ton,
    Dex
    Last edited by DexterG; 02-14-2013 at 11:10 AM.

  2. #2
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Using average with other formulas

    Hi Dex,

    Please upload a sample workbook along with your expected results. Thanks.


    Regards,
    DILIPandey
    <click on below * if this helps>
    DILIPandey, Excel rMVP
    +919810929744 (India), +971528225509 (Dubai), [email protected]

  3. #3
    Registered User
    Join Date
    12-07-2012
    Location
    london, england
    MS-Off Ver
    Excel 2003
    Posts
    43

    Re: Using average with other formulas

    Please find file attached to help you understand what I am looking for.

    Thanks
    Attached Files Attached Files

  4. #4
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Using average with other formulas

    Hi DexerG, I observed that sometime you are considering 2 number in average function and sometime you are considering 1 or 3 numbers ... any logic for that ? thanks.



    Regards,
    DILIPandey
    <click on below * if this helps>

  5. #5
    Registered User
    Join Date
    12-07-2012
    Location
    london, england
    MS-Off Ver
    Excel 2003
    Posts
    43

    Re: Using average with other formulas

    Hi Dilipandey,
    That's because am dividing stocks as per quartiles each time (i. 0-25%, 25-50%, 50-75%, 75-100%).

    So from the time 1 appears in column B, till the next time 1 appears, if there are 8 cells in between, Column A cells should be divided into 4 groups of 2 each (i.e 25% in each) and the 2 numbers should be averaged, in each quartile.

    Similarly from the time 1 appears in column B, till the next time 1 appears, if there are 12 cells in between, cells should be divided into 4 groups of 3 each and 3 numbers should be averaged in each quartile.

    Quartile function helps to divide cells into.... well, quartiles!

    Alternatively, I can divide the range by 4 - Such as in the COUNTIF function below:
    IF(AND(U2=1,COUNTIF(U3:U$40000,1)),COUNTIF((L2:INDEX(L3:INDEX(L3:L40000,INT((MATCH(1,U3:U40000,0)-1)/4)),)),">0"),"")

    But I can't seem to find the average incorporating any of the methods above, I am probably getting my formula's wrong as I am still a newbie.

    Hoping someone can help me soon.

    Thanks,
    Dex
    Last edited by DexterG; 02-14-2013 at 11:11 AM.

  6. #6
    Registered User
    Join Date
    12-07-2012
    Location
    london, england
    MS-Off Ver
    Excel 2003
    Posts
    43

    Re: [Unsolved] Using average with other formulas

    Unsolved problem! Need help!!

  7. #7
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,461

    Re: [Unsolved] Using average with other formulas

    Is this are you looking for?
    Press Ctrl-F3 to see name Quar_1 to 4
    Attached Files Attached Files
    Quang PT

  8. #8
    Registered User
    Join Date
    12-07-2012
    Location
    london, england
    MS-Off Ver
    Excel 2003
    Posts
    43

    Re: Using average with other formulas

    Thanks bebo021999! Exactly what I was looking for!!

    Regards,
    Dex

+ 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