Select to view content in your preferred language

How would be VBScritp for VLOOKUP function by Field Calculator ?

5736
3
02-26-2015 07:49 AM
GabrielaCorrea
Deactivated User

Hello!

I would like to know if it's possible to use VLOOKUP formula by Field Calculator.

I need to fill some informations according to data in attribule table. To exemplify, i'm using this table below.   

column Acolumn Bcolumn Ccolumn D
COTMOTTOMCOTJOTTOJ
row 3AD288abAD2
row 4DF387abAD2
row 5TR586abTR5
row 6GH485abFS2
row 7FS284abTR5

If were to do the calculation by Excel, the operation would be simple, like: D3 = VLOOKUP (C3;A:B;2;FALSE)

How would be VBAcript for VLOOKUP function by Field Calculator?If someone know how to help me, I appreciate.

Gabriela

0 Kudos
3 Replies
XanderBakker
Esri Esteemed Contributor

Does it have to be in the Field Calculator? If not you could summarize the table based on field COTM and taking the first of field OTTOM, then join the output table to this table on the field COTJ and fill field OTTOJ with the values from the joined field OTTOM.

0 Kudos
GabrielaCorrea
Deactivated User

Indeed. It's a great solution.

I had thought to use VLOOKUP function 'cause in fact I have to do this process more than once and with different variables in the same atttibutes table, but I can do that with summarize... perhaps it's take more time, but it's possible.

Thank you!

0 Kudos
XanderBakker
Esri Esteemed Contributor

If you have to do it multiple times, you could consider using some python code (to do this automatically). If you need some help with it, let me know.