ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   how can i use the ISNA and Vlookup funtions in a macro? (https://www.excelbanter.com/excel-programming/349523-how-can-i-use-isna-vlookup-funtions-macro.html)

jack

how can i use the ISNA and Vlookup funtions in a macro?
 
I would like to use the Vlookup function in a macro, and the ISNA function.
Can this be done?

Jim Thomlinson[_5_]

how can i use the ISNA and Vlookup funtions in a macro?
 
You can but you don't have to...

=if(isna(vlookup(This, InThat, 2,false)), "Not Found", vlookup(This, InThat,
2,false))

or you can use CountIf

=if(countif(InThat, This)=0, "Not Found", vlookup(This, InThat, 2,false))

I prefer the second method, but it is up to you...
--
HTH...

Jim Thomlinson


"Jack" wrote:

I would like to use the Vlookup function in a macro, and the ISNA function.
Can this be done?


jack

how can i use the ISNA and Vlookup funtions in a macro?
 
Thanks
i was trying to use a macro to cut down on the size of the file and the
number of cells with the long formula

i will try the countif

"Jim Thomlinson" wrote:

You can but you don't have to...

=if(isna(vlookup(This, InThat, 2,false)), "Not Found", vlookup(This, InThat,
2,false))

or you can use CountIf

=if(countif(InThat, This)=0, "Not Found", vlookup(This, InThat, 2,false))

I prefer the second method, but it is up to you...
--
HTH...

Jim Thomlinson


"Jack" wrote:

I would like to use the Vlookup function in a macro, and the ISNA function.
Can this be done?



All times are GMT +1. The time now is 08:34 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com