Array Formula for Max Value with Conditions

PoggiPJ

Active Member
Joined
Mar 25, 2008
Messages
330
Originally I only needed the latest date in a list - simple, Max(A2:A7). Now I need to only consider end dates where the Extended Total is >0. I understand the basics of how array formulas work and have written some simple ones, but I am struggling with an array formula that will give me the max of col A when Col B > 0. In the following example rows 3 and 5 would be excluded and the result would be 5/31/2016. Would really appreciate some help.

Excel 2003
AB
1Coverage Ends Extended Total
23/1/2013 4,339.00
312/31/2017 -
45/15/2015 39,992.00
57/31/2016 -
64/1/2013
75/31/2016 5,422.00

<tbody>
</tbody>
Sheet1
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.

Robert Mika

MrExcel MVP
Joined
Jun 29, 2009
Messages
7,256
Originally I only needed the latest date in a list - simple, Max(A2:A7). Now I need to only consider end dates where the Extended Total is >0. I understand the basics of how array formulas work and have written some simple ones, but I am struggling with an array formula that will give me the max of col A when Col B > 0. In the following example rows 3 and 5 would be excluded and the result would be 5/31/2016. Would really appreciate some help.

Excel 2003
AB
1Coverage Ends Extended Total
23/1/2013 4,339.00
312/31/2017 -
45/15/2015 39,992.00
57/31/2016 -
64/1/2013
75/31/2016 5,422.00

<tbody>
</tbody>
Sheet1

<b>Excel 2010</b><table cellpadding="2.5px" rules="all" style=";background-color: #FFFFFF;border: 1px solid;border-collapse: collapse; border-color: #BBB"><colgroup><col width="25px" style="background-color: #DAE7F5" /><col /><col /><col /><col /></colgroup><thead><tr style=" background-color: #DAE7F5;text-align: center;color: #161120"><th></th><th>A</th><th>B</th><th>C</th><th>D</th></tr></thead><tbody><tr ><td style="color: #161120;text-align: center;">1</td><td style=";">Coverage Ends</td><td style=";">Extended Total</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td></tr><tr ><td style="color: #161120;text-align: center;">2</td><td style="text-align: right;;">3/1/2013</td><td style="text-align: right;;">4,339.00</td><td style="text-align: right;;"></td><td style="text-align: right;;">5/31/2016</td></tr><tr ><td style="color: #161120;text-align: center;">3</td><td style="text-align: right;;">12/31/2017</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td></tr><tr ><td style="color: #161120;text-align: center;">4</td><td style="text-align: right;;">5/15/2015</td><td style="text-align: right;;">39,992.00</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td></tr><tr ><td style="color: #161120;text-align: center;">5</td><td style="text-align: right;;">7/31/2016</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td></tr><tr ><td style="color: #161120;text-align: center;">6</td><td style="text-align: right;;">4/1/2013</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td></tr><tr ><td style="color: #161120;text-align: center;">7</td><td style="text-align: right;;">5/31/2016</td><td style="text-align: right;;">5,422.00</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td></tr></tbody></table><p style="width:3.6em;font-weight:bold;margin:0;padding:0.2em 0.6em 0.2em 0.5em;border: 1px solid #BBB;border-top:none;text-align: center;background-color: #DAE7F5;color: #161120">Sheet3</p><br /><br /><table width="85%" cellpadding="2.5px" rules="all" style=";border: 2px solid black;border-collapse:collapse;padding: 0.4em;background-color: #FFFFFF" ><tr><td style="padding:6px" ><b>Array Formulas</b><table cellpadding="2.5px" width="100%" rules="all" style="border: 1px solid;text-align:center;background-color: #FFFFFF;border-collapse: collapse; border-color: #BBB"><thead><tr style=" background-color: #DAE7F5;color: #161120"><th width="10px">Cell</th><th style="text-align:left;padding-left:5px;">Formula</th></tr></thead><tbody><tr><th width="10px" style=" background-color: #DAE7F5;color: #161120">D2</th><td style="text-align:left">{=MAX(<font color="Blue">IF(<font color="Red">B2:B7>0,A2:A7</font>)</font>)}</td></tr></tbody></table><b>Entered with Ctrl+Shift+Enter.</b> If entered correctly, Excel will surround with curly braces {}.
<b>Note: Do not try and enter the {} manually yourself</b></td></tr></table><br />
 

PoggiPJ

Active Member
Joined
Mar 25, 2008
Messages
330
Robert, thank you very much. I was definitely going down the wrong path with my thinking. That worked perfectly.
 

Watch MrExcel Video

Forum statistics

Threads
1,132,807
Messages
5,655,420
Members
418,198
Latest member
jad1984

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top