+ Reply to Thread
Results 1 to 7 of 7

If statement to calculate an average

  1. #1
    Forum Contributor
    Join Date
    01-05-2010
    Location
    New York
    MS-Off Ver
    Excel 2016
    Posts
    747

    If statement to calculate an average

    I would like to write a IF statement that says if a value in Column Q is greater then 5%, then calculate for each column (R:AQ) the average of those rows with a value greater than 5% in Column Q.
    Attached Files Attached Files
    Last edited by rhudgins; 04-13-2010 at 01:28 PM.

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: If statement to caluclate an average

    Do you mean?

    In Q18:

    =AVERAGE(IF($Q$2:$Q$13>5%,Q$2:Q$13))

    confirmed with CTRL+SHIFT+ENTER
    not just ENTER and copied across all columns.
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Forum Contributor
    Join Date
    01-05-2010
    Location
    New York
    MS-Off Ver
    Excel 2016
    Posts
    747

    Re: If statement to caluclate an average

    Thanks that works but is there a way to do it without CTRL+SHIFT+ENTER because when I hit F2 on the value it returns #VALUE

  4. #4
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: If statement to caluclate an average

    Try:

    =SUMIF($Q$2:$Q$13,">5%",Q$2:Q$13)/COUNTIF($Q$2:$Q$13,">5%")

  5. #5
    Forum Contributor
    Join Date
    01-05-2010
    Location
    New York
    MS-Off Ver
    Excel 2016
    Posts
    747

    Re: If statement to caluclate an average

    The second formula is much better but instead of having 5% embedded in the formula I would like to have it in a seperate cell so that I can change it to 4%, 3%, 2% or what ever other number I chose. When I try to replace the ">5%" with ">$M$17$" the formula will not work. Can this be fixed? Thanks so much.

  6. #6
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: If statement to caluclate an average

    Try

    =SUMIF($Q$2:$Q$13,">"&$M$17,Q$2:Q$13)/COUNTIF($Q$2:$Q$13,">"&$M$17)

  7. #7
    Forum Contributor
    Join Date
    01-05-2010
    Location
    New York
    MS-Off Ver
    Excel 2016
    Posts
    747

    Re: If statement to calculate an average

    Perfect. Thanks for all of your help!

+ 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