vlookup question

slindale

New Member
Joined
Aug 28, 2006
Messages
6
I am using vlookup (exact matcht) to retreive data from another spreadheet in the same workbook. Sometimes there will not be a match. How can I make excel return a value of zero if there is no match? I have been working on this for a long time. Any ideas would be greatly appreciated.

Thanks,
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
I'd wrap an if-statement around it.

Instead of:
=VLOOKUP(A2,lookup_rng,2,0)

Use something like:
=IF(COUNTIF(lookup_rng,A2)=0,0,VLOOKUP(A2,lookup_rng,2,0))

HTH
 
Upvote 0
Using the COUNTIF statement is a better idea, the formula I made isnt exactly fullproof, VLOOKUP being the fickle beast it is.
 
Upvote 0

Forum statistics

Threads
1,214,943
Messages
6,122,380
Members
449,080
Latest member
Armadillos

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