SOLVED

# IF this than that function in excel

Copper Contributor

# IF this than that function in excel

Hi,

I am wondering if there is a formula for the following:

Column T (50 rows) represents descriptions

Column V (50 rows) represents a code which is linked to the description

For example:

 T V 1 Apple 1234 2 Pear 2234

Column H (800 rows) is a drop-down of the descriptions in column T

Column F (800 rows) should represent the code (column V) matching the description in column H

For example:

 F H 1 =V1 =T1 2 =V49 =T49

So I am looking for an efficient way to implement in Column F something like:

IF (H1=T1;V1) or (H1=T1:T50;V1:V50) Needless to say, these formulas do not work

to automatically adjust the code in column F when a description is appointed in column H.

Is there a clever way to do so?

Hope someone can help me with this.

2 Replies
best response confirmed by Grahmfs13 (Microsoft)
Solution

# Re: IF this than that function in excel

``=IFERROR(INDEX(\$V\$1:\$V\$50,MATCH(H1,\$T\$1:\$T\$50,0)),"")``

You can try INDEX and MATCH. An alternative could be VLOOKUP. If you work with Office365 you can apply XLOOKUP.

# Re: IF this than that function in excel

YES IT WORKS!!! Thank you so much for your response!
1 best response

Accepted Solutions
best response confirmed by Grahmfs13 (Microsoft)
Solution

# Re: IF this than that function in excel

``=IFERROR(INDEX(\$V\$1:\$V\$50,MATCH(H1,\$T\$1:\$T\$50,0)),"")``

You can try INDEX and MATCH. An alternative could be VLOOKUP. If you work with Office365 you can apply XLOOKUP.