+ Reply to Thread
Results 1 to 8 of 8

Averaging Cell with Multiple Criteria plus Forced Minimum Values

  1. #1
    Registered User
    Join Date
    10-18-2012
    Location
    Surrey, BC
    MS-Off Ver
    Excel 2016
    Posts
    84

    Averaging Cell with Multiple Criteria plus Forced Minimum Values

    Hi there, I been pulling hair (what's left of it!) trying to work through what I have been tasked with.

    My goal is to get the average value based on the value in 'L4:L18' below, using the search value in 'L2' as shown below. This I can do...

    Additionally (where to trouble begins), I need to somehow force the values in 'M4:M18' without physically changing them if they are under $500. So in the example below, averaging 'L' values that equal '22222' would use a value of $500 for 'M11' instead of the listed $350.

    So instead of the actual average of $637... the result would be $667, changing the $350 value to $500.

    Is something like this possible?

    average.PNG


    Thanks
    Craig

  2. #2
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2024
    Posts
    6,172

    Re: Averaging Cell with Multiple Criteria plus Forced Minimum Values

    Try this:

    =AVERAGE(IF($L$4:$L$18=L2,IF($M$4:$M$18<500,500,$M$4:$M$18)))

    Enter with Ctrl+Shift+Enter.

  3. #3
    Valued Forum Contributor Root_'s Avatar
    Join Date
    07-29-2017
    Location
    _
    MS-Off Ver
    2010+
    Posts
    514

    Re: Averaging Cell with Multiple Criteria plus Forced Minimum Values

    Or this non-array formula:

    =(SUMIFS(M4:M18,L4:L18,L2,M4:M18,">=500")+COUNTIFS(L4:L18,L2,M4:M18,"<500")*500)/COUNTIF(L4:L18,L2)

  4. #4
    Registered User
    Join Date
    10-18-2012
    Location
    Surrey, BC
    MS-Off Ver
    Excel 2016
    Posts
    84

    Re: Averaging Cell with Multiple Criteria plus Forced Minimum Values

    Both solutions worked awesome!

    I feel kind of silly how simple you both made it...

    Thank you both for your help!
    Craig

  5. #5
    Registered User
    Join Date
    10-18-2012
    Location
    Surrey, BC
    MS-Off Ver
    Excel 2016
    Posts
    84

    Re: Averaging Cell with Multiple Criteria plus Forced Minimum Values

    For what ever reason, once I tried to add this to my real world data... something went wrong.

    I have attached a sample workbook the has the calculations to account for the $500 minimum based on the formulas offered earlier (column B) and another column (C) that I have placed $500 in place of values that were under the $500 mark.

    I would think that the search averages in B2 and C2 and the average totals in B4 and C4 should match... but they don't, so I must have done something wrong. I also noticed that if I change the ending row value to cover any expansion, the values would change even if the additional rows are blank so may need to add criteria to skip blank cells.

    I would appreciate any help in getting me headed in the right direction...

    Thanks
    Craig
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    10-18-2012
    Location
    Surrey, BC
    MS-Off Ver
    Excel 2016
    Posts
    84

    Re: Averaging Cell with Multiple Criteria plus Forced Minimum Values

    After some more testing... I can now see that my variance is due to some of the rows having no values... which will happen. So I need to add a check in the formula to skip blank cells.

    How do I go about adding this check... do I use averageifs? Would need to skip B10:B1000 if a blank cell was found. I have tried changing to averageifs but get errors...

    =AVERAGE(IF($A$10:$A$1000=$J$3,IF($B$10:$B$1000<$M$3,$M$3,$B$10:$B$1000)))

  7. #7
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2024
    Posts
    6,172

    Re: Averaging Cell with Multiple Criteria plus Forced Minimum Values

    Change formula to:

    =AVERAGE(IF($A$10:$A$1000=$J$3,IF($B$10:$B$1000<>"",IF($B$10:$B$1000<$M$3,$M$3,$B$10:$B$1000))))

    Enter with Ctrl+Shift+Enter.

  8. #8
    Registered User
    Join Date
    10-18-2012
    Location
    Surrey, BC
    MS-Off Ver
    Excel 2016
    Posts
    84

    Re: Averaging Cell with Multiple Criteria plus Forced Minimum Values

    Excellent... works perfectly!

    Thank you so much...

    Craig

+ 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. [SOLVED] Selecting minimum based on multiple criteria
    By Vend1301 in forum Excel Formulas & Functions
    Replies: 14
    Last Post: 02-09-2016, 02:03 PM
  2. [SOLVED] locate minimum value which satisfy multiple criteria
    By keby1nko in forum Excel General
    Replies: 3
    Last Post: 05-11-2015, 03:41 AM
  3. Formula for Averaging Array Given Multiple Criteria
    By celestealexandra in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 05-20-2014, 11:56 AM
  4. [SOLVED] Finding minimum and maximum values based on multiple criteria and filtered data
    By jndreece in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 05-13-2014, 10:42 AM
  5. [SOLVED] Find minimum (ignoring blank cell or zero values) with Multiple Criteria
    By Joeywei in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 05-27-2013, 08:45 PM
  6. Averaging values, excluding minimum value
    By LoriR in forum Excel General
    Replies: 10
    Last Post: 04-22-2011, 03:45 AM
  7. Minimum values based on criteria in another cell
    By ekm in forum Excel General
    Replies: 6
    Last Post: 07-16-2010, 02:33 PM

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