Just a formula help i think

shadow12345

Well-known Member
Joined
May 10, 2004
Messages
1,238
Hi,

I am using a min formula to return the lowest value from two cells by vlookup.

MIN(VLOOKUP($A66,$A$5:$L$14,9,FALSE),VLOOKUP($A66,$A$5:$L$14,11,FALSE)

It works fine if both cells have a value (col 9 and Col 11) but if one is blank then it decides that mean its a zero... thus messing up my min formula.

Can anyone help, i want it to show correctly (ie if only one has a value then show that, if both have a value then show the min)
 

Excel Facts

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

I am using a min formula to return the lowest value from two cells by vlookup.

MIN(VLOOKUP($A66,$A$5:$L$14,9,FALSE),VLOOKUP($A66,$A$5:$L$14,11,FALSE)

It works fine if both cells have a value (col 9 and Col 11) but if one is blank then it decides that mean its a zero... thus messing up my min formula.

Can anyone help, i want it to show correctly (ie if only one has a value then show that, if both have a value then show the min)
Is it possible that both cells from the lookups could be empty?

What kind of numbers are you dealing with? What would be the highest value in your lookup tables?
 
Upvote 0
yes both could be blank (but i have that part covered in my whole formula (the complete one is much longer)

The numbers will be anywhere between -10000 and 10000 (posssibly with decimals as well)
 
Upvote 0
yes both could be blank (but i have that part covered in my whole formula (the complete one is much longer)

The numbers will be anywhere between -10000 and 10000 (posssibly with decimals as well)
In that case you might be better off putting the VLOOKUPs in separate cells and then testing those cells for the min value.

A1:

=IF(VLOOKUP($A66,$A$5:$L$14,9,0)="","",VLOOKUP($A66,$A$5:$L$14,9,0))

A2:

=IF(VLOOKUP($A66,$A$5:$L$14,11,0)="","",VLOOKUP($A66,$A$5:$L$14,11,0))

Then:

=MIN(A1:A2)
 
Upvote 0
I could be wrong but just an idea...... will this work?
Code:
MIN(min(VLOOKUP($A66,$A$5:$L$14,9,FALSE),0),min(VLOOKUP($A66,$A$5:$L$14,11,FALSE),0))

Asad
 
Upvote 0

Forum statistics

Threads
1,224,597
Messages
6,179,808
Members
452,944
Latest member
2558216095

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