can a vlookup in a nested if produce a replace statement

murdo7

New Member
Joined
May 27, 2002
Messages
38
This is the problem:


I have 2 columns of info - one with codes and another with prices.

i require to change column 2's prices from a second spreadsheet containing the same (but not quite) codes and prices.
some of the codes do not exist on the new spreadsheet and some of the prices do not need to change.

For instance in columns
A1 : : B1 and in D1 : E1
1121 : 6.99 : 1121 : 7.99
1122 : 6.99 : 1122 : 6.99
1123 : 5.00 : 1123 : 5.99
1124 : 7.00 : 1125 : 1.00
1125 : 0.99 : 1127 : 2.00
1126 : 3.33
1127 : 1.99

I need to preserve the codes and prices in A1 and B1 that dont appear in the column D1 and E1 then in B1 only the prices that have changed are replaced and not the ones that dont appear in range D1 E1.

I have tried vlookup in F1 to identify D1 code in A1 - that works fine.
=IF(ISNA(VLOOKUP(A2,$A$2:$B$7,1,FALSE)),A2&"Not Found",VLOOKUP(A2,$A$2:$B$7,1,FALSE)

But i now need it to find the code and then change the price!! if it needs changing

Help
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.

Forum statistics

Threads
1,215,263
Messages
6,123,958
Members
449,135
Latest member
jcschafer209

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