Vlookup Macro

bhieatza

New Member
Joined
Apr 27, 2016
Messages
18
I have a Vlookup function that works great but I can not figure out how to get it working in a macro. The function is
=IF(ISNA(VLOOKUP(AU2,Sheet1!F:F,1,0)),"",VLOOKUP(AU2,Sheet1!F:G,2,FALSE))
an it is posted in column AP and copied all the way down. Any suggestions?

Thanks for your help.
 
D.ServicesD30.HVACD3020.Heat.Generating.SystemsD3021.BoilersBoiler, Electric, 101 to 144 kW, Replace
20836D.ServicesD30.HVACD3020.Heat.Generating.SystemsD3021.BoilersBoiler, Electric, 101 to 144 kW, Replace

<colgroup><col><col><col><col><col><col></colgroup><tbody>
</tbody>

I changed yours above to reflect AP2 and nothing comes up in the column(first row first column above). The second row is with the vlookup function. I don't know what i am doing wrong.
 
Upvote 0

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
=IF(ISNA(VLOOKUP(AU2,Sheet1!F:F,1,0)),"",VLOOKUP(AU2,Sheet1!F:G,2,FALSE))

So am I reading your formula correct...

If AU2 value is in not column F, then return "" (nothing) otherwise look in column F for AU2 value and return the value in G.
of the same row.

SO if AU2 value is not in column F there is nothing for value_if_true to return and nothing for value_ if_false to return.

Going further if vlookup cannot match the lookup value it will return #N/A and your formula with the ISNA is on the lookout for #N/A and if found then returns "".

Then the value_if_false portion can't find the same value in the same column either.

Is that correct or am I screwed up...

Howard
 
Upvote 0
So am I reading your formula correct...

If AU2 value is in not column F, then return "" (nothing) otherwise look in column F for AU2 value and return the value in G.
of the same row.

SO if AU2 value is not in column F there is nothing for value_if_true to return and nothing for value_ if_false to return.

Going further if vlookup cannot match the lookup value it will return #N/A and your formula with the ISNA is on the lookout for #N/A and if found then returns "".

Then the value_if_false portion can't find the same value in the same column either.

Is that correct or am I screwed up...

Howard
if there is no value in AU2 then return nothing. if there is a value in AU2 then look for that value in column f of sheet 1 and return the corresponding value found in column g of sheet 1 in cell AP2
 
Upvote 0
How about posting a link to an example workbook along with a re statement of what you want to happen and where.

Refer to specific cells, rows, columns in you instructions.

You cannot attach a workbook, but a link is okay. I use drop box to do that but there are other link utilities. No photo or shared workbook please.

I will take a look and see if we can get you going.

Howard
 
Upvote 0

Forum statistics

Threads
1,215,492
Messages
6,125,115
Members
449,206
Latest member
burgsrus

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