VLOOKUP Getting rid of #NA

1kmonro

New Member
Joined
Jul 12, 2009
Messages
37
I'm using VLOOKUP to grab data and fill fields in a column. There are two conditions I want to prevent.

The first is when the lookup doesn't find a match. It currently returns a #NA. I want it to just leave the field alone.

The second is when it finds a match but there is already data in the field - again I want it to leave the field alone.

Is there a way to do this?
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
1kmonro,

Please post the VLOOKUP formula that is returning "#N/A".

What do you want to return in the cell if there is an error? Blank or zero?
 
Upvote 0
What do you mean by leave the field alone? You can enclose the vlookup in an ISNA function: for example =if(isna(vlookup(...)),"",vlookup(...))
 
Upvote 0
Here's the formula:

=VLOOKUP(C94,'PaymentInfo'A4:F428,6,FALSE)

It grabs the parent code (C94) and looks for a match in the PaymentInfo sheet. This sheet is overwritten at least 3-7 times a month so sometimes a particular parent code is there and sometimes it isn't. When it finds a match it moves to column 6 and pulls the data back into the original sheet. If there's no match it goes back to the original sheet and enters an #NA.

I would truly like it leave the target field blank if there is no match. Or (and I didn't mention this originally) I would like it to sum what is currently in the target field with the new amount that it found.

I hope that this makes sense but want to thank you for even responding.
 
Upvote 0
1kmonro,

Try:

=IF(ISNA(VLOOKUP(C94,PaymentInfo!A4:F428,6,FALSE)),"",VLOOKUP(C94,PaymentInfo!A4:F428,6,FALSE))
 
Upvote 0
Sorry to butt in on 1kmonro's question but I have one relating to it. Can this formula be used as a conditional format for an entire sheet or can you suggest one that might work?
 
Upvote 0

Forum statistics

Threads
1,215,684
Messages
6,126,199
Members
449,298
Latest member
Jest

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