What happens if max is blank?

shadow12345

Well-known Member
Joined
May 10, 2004
Messages
1,238
I am using the below formula.

=MAX(VLOOKUP(E$49,$A$5:$L$14,5,FALSE),VLOOKUP(E$49,$A$5:$L$14,7,FALSE))

To return the maxium value which is fine if both field have a value but if not then I get an error ....

Easy enough to fix, put a zero in the blank fields.

My question is this, can I avoid having to put the zero... because i plan to also use the same again but with a MIN function... which will give the wrong value (0).


Any ideas?
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
Code:
=if(iserror(max(vlookup(e$49,$a$5:$l$14,5,false),vlookup(e$49,$a$5:$l$14,7,false))),"",max(vlookup(e$49,$a$5:$l$14,5,false),vlookup(e$49,$a$5:$l$14,7,false)))
 
Upvote 0
Something like:
Rich (BB code):
=IF(AND(MAX(A5:L14)>0,MAX(A7:L14)>0),MAX(VLOOKUP(E$49,$A$5:$L$14,5,FALSE),VLOOKUP(E$49,$A$5:$L$14,7,FALSE)),your condition if maximum value of either range is not higher than 0)
 
Upvote 0
I am using the below formula.

=MAX(VLOOKUP(E$49,$A$5:$L$14,5,FALSE),VLOOKUP(E$49,$A$5:$L$14,7,FALSE))

To return the maxium value which is fine if both field have a value but if not then I get an error ....

Easy enough to fix, put a zero in the blank fields.

My question is this, can I avoid having to put the zero... because i plan to also use the same again but with a MIN function... which will give the wrong value (0).


Any ideas?
On Excel 2007 or later...

Code:
=MAX(
 IFERRORVLOOKUP(E$49,$A$5:$L$14,5,0),0),
 IFERROR(VLOOKUP(E$49,$A$5:$L$14,7,0),0))


On all versions...

Define BigNum as referring to

=9.99999999999999E+307

Now we can invoke:

Code:
=MAX(
   LOOKUP(BigNum,CHOOSE({1,2},0,VLOOKUP(E$49,$A$5:$L$14,5,0))),
   LOOKUP(BigNum,CHOOSE({1,2},0,VLOOKUP(E$49,$A$5:$L$14,7,0))))
 
Upvote 0

Forum statistics

Threads
1,224,586
Messages
6,179,728
Members
452,939
Latest member
WCrawford

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
Back
Top