+ Reply to Thread
Results 1 to 5 of 5

Max based on conditions

  1. #1
    Forum Contributor
    Join Date
    05-05-2014
    Location
    Dallas, TX
    MS-Off Ver
    Excel 2013
    Posts
    103

    Max based on conditions

    Hello,

    I am looking for a formula for A50 in summary sheet new that will find the Max value in the Inventory Turnover sheet of Column H, based on the condition that its corresponding cell in column C s greater than 0, and returns its corresponding item number to cell A50 on the summary sheet page. Here is my formula, but it is not ignoring the 0s in column C. Thanks!
    =INDEX('Inventory Turnover'!A:A,MATCH(MAX(IF('Inventory Turnover'!C:C<>0,'Inventory Turnover'!H:H,""),'Inventory Turnover'!H:H),'Inventory Turnover'!H:H,0),1)
    Attached Files Attached Files

  2. #2
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,712

    Re: Max based on conditions

    Try this array formula

    =INDEX('Inventory Turnover'!A:A,MATCH(1,('Inventory Turnover'!H:H=MAX(IF('Inventory Turnover'!C:C<>0,'Inventory Turnover'!H:H)))*('Inventory Turnover'!C:C<>0),0))

    ....although it's probably better to use a fixed range, e.g. 1000 rows, otherwise the formula will be slow referencing whole columns.....
    Audere est facere

  3. #3
    Forum Contributor
    Join Date
    05-05-2014
    Location
    Dallas, TX
    MS-Off Ver
    Excel 2013
    Posts
    103

    Re: Max based on conditions

    Worked! Why the Match(1,) if you don't mind me asking.

  4. #4
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,712

    Re: Max based on conditions

    In the formula there are two conditions multiplied in the MATCH function (shown in blue and red)

    =INDEX('Inventory Turnover'!A:A,MATCH(1,('Inventory Turnover'!H:H=MAX(IF('Inventory Turnover'!C:C<>0,'Inventory Turnover'!H:H)))*('Inventory Turnover'!C:C<>0),0))

    So when you multiply TRUE/FALSE arrays you only get 1 when both conditions are TRUE......so the MATCH is with 1 because that finds the first row where both conditions are TRUE

    The conditions are, effectively

    Column H is equal to the max value of col H when Col C is > 0

    and

    Col C > 0

  5. #5
    Forum Contributor
    Join Date
    05-05-2014
    Location
    Dallas, TX
    MS-Off Ver
    Excel 2013
    Posts
    103

    Re: Max based on conditions

    Thank 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. calculation using reference to cells based on conditions
    By shrimic in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-16-2012, 12:32 PM
  2. Max Value Based on Conditions
    By gav0101 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 03-26-2008, 10:03 AM
  3. Counting based upon 2 conditions that are text based
    By walkerdayle in forum Excel General
    Replies: 7
    Last Post: 08-21-2006, 08:35 PM
  4. [SOLVED] Sum based on two conditions
    By luvgreen in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-10-2006, 03:29 AM
  5. Sum based on conditions
    By Hakojin in forum Excel General
    Replies: 4
    Last Post: 05-23-2006, 01:10 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