I am trying to use a match or lookup function

Marc Enzi

Board Regular
Joined
Dec 13, 2004
Messages
92
I am trying to use either MATCH or VLOOKUP to lookup data, the trouble I am having is when the lookup value is not exact. I don't wan't the nearest value, instead I wan't a default number.

However if the field being evaluated is blank, then I don't want the formula to run...

can anyone help?
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
Can you post a sample of the data that you're working with?

You can use =VLOOKUP(Ref,Data,Columns,False) to return an exact match.

One method to eliminate errors if a match isn't found is =IF(ISNA(VLOOKUP),"",VLOOKUP) but there are more efficient ways, like =IF(Ref="","",VLOOKUP)

HTH,

Smitty
 
Upvote 0
Try this Formula
Code:
=IF(ISBLANK(D1),"",IF(ISNA(INDEX(B1:B10,MATCH(D1,A1:A10,0))),"DEFAULT VALUE",INDEX(B1:B10,MATCH(D1,A1:A10,0))))

Where D1 is where you input what you are looking for,
Column A houses the lookup information,
and Column B Houses the return information.

Let me know if this does the trick :)
 
Upvote 0

Forum statistics

Threads
1,213,494
Messages
6,113,981
Members
448,538
Latest member
alex78

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