vlookup - Retaining original cell value if blank is returned by vlookup

ds2016

New Member
Joined
Feb 29, 2016
Messages
5
Hi,

I am trying to use vlookup to match on a unique ID(Column A), and if a match is found populate the value in column B. However, if the match returns a blank value (As column B does not have a value, even though a match exists based on Unique ID (not an error) then I want to retain the original value of the cell.

Can anyone help me with the formula?

Appreciate it,
DS

Using Excel 2013.
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
Care to post the formula you have tried and indicate what the formula ordinarily returns, text perhaps?


Right now the below is what I have, but this retains the value, if a match is not found. The solution I am looking for is; if a match is found and it is a value (text) then I want the value; however, if it is blank then I want the original value of the cell retained.


formula in Sheet 2

Cell # AP2
=IFERROR(VLOOKUP($D2,'Sheet1'!$A$3:$EW$2000,10,0), AP2)
 
Upvote 0
Right now the below is what I have, but this retains the value, if a match is not found. The solution I am looking for is; if a match is found and it is a value (text) then I want the value; however, if it is blank then I want the original value of the cell retained.


formula in Sheet 2

Cell # AP2
=IFERROR(VLOOKUP($D2,'Sheet1'!$A$3:$EW$2000,10,0), AP2)

Why is it not D2, but AP2? Isn't D2 the original value?
 
Upvote 0
Why is it not D2, but AP2? Isn't D2 the original value?

Well d2 is the value I am matching (the unique ID), AP2 is the value in the cell I am writing the formula in. I want to retain the value in the cell I am writing the vlookup formula in, if a blank value is returned.

Again, if vlookup is not the correct formula, then I am open to other suggestions.

Below is another shot at explain what I am trying to do -

Sheet 1
Column A - Unique ID
Column J - The value I want to pull into sheet 2 based on a match

Sheet 2

Column D - Unique ID (to match to column a on sheet 1)
Column AP - Populate with value returned from column J, if not blank. If blank then want to retain the value in column AP. (Column AP is already populated with text)

Thanks,
Div
 
Upvote 0

Forum statistics

Threads
1,216,009
Messages
6,128,261
Members
449,435
Latest member
Jahmia0616

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