Issues with IFNA

rollingzep

Board Regular
Joined
Nov 18, 2013
Messages
214
Office Version
  1. 365
Platform
  1. Windows
I am trying to execute this VLookup but getting Application- Defined Or Object defined error
<code>
ws.Range("BE2:BE" & ws.Cells(Rows.Count, "AG").End(xlUp).Row).FormulaR1C1 = "=IF(ISNA(VLOOKUP(""*""&RC[-24]&""*"",HQLA!C2:C4,4,0)),"Not Found", VLOOKUP(""*""&RC[-24]&""*"",HQLA!C1:C4,4,0))"
</code>

I am trying to Lookup C2 if in case of #N/A or C1 if it is a match.

Alternatively, is it possible to just have an IF condition to look up C1 or C2?
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
I modified my code to
ws.Range("BE2:BE" & ws.Cells(Rows.Count, "AG").End(xlUp).Row).FormulaR1C1 = "=IF(ISNA(VLOOKUP(""*""&RC[-24]&""*"",HQLA!C2:C4,4,0)),""Not Found"", VLOOKUP(""*""&RC[-24]&""*"",HQLA!C1:C4,4,0))"

and it returns Not Found in place of #N/A

aIs it possible to have a MID function inside the VLookup?

as in VLOOKUP(""*""&RC[-24]&""*"",HQLA!MID(C2, 3,9):C4,4,0))?
 
Upvote 0

Forum statistics

Threads
1,215,778
Messages
6,126,841
Members
449,343
Latest member
DEWS2031

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