VLOOKUP with LEFT and RIGHT Function

SAXON10

Board Regular
Joined
Jun 1, 2017
Messages
109
Hi,

I am trying to combine the Vlookup, Left and Right function in one cell.


Column F3:F12 contain of number and G3:G12 is type and Column A is a lookup value for last four
characters (A3:A14).

I am apply the following formula in C3="K"&LEFT(VLOOKUP(RIGHT(--$A3,4)&"*",$F$3:$G$12,2,0),2) based on the below

data but I am getting error.

Any help would be appreciated


DESIRED RESULT

A B C
DATA

F G

CODERESULTFORMULA REQUIREDCODETYPE
3187K16 10000318716KPY
3196K16 10000319616KPY
3135K18 10000313518KPY
NONE 10000320618KPY
NONE 10000285318KPY
3208K18 10000320818KPY
3206K18 10000313918KPY
3139K18 10000315418KPY
3154K18 10000315918KPY
3159K18 10000321316KPY
3199K18
3133K16

<colgroup><col span="2"><col><col span="2"><col><col></colgroup><tbody>
</tbody>
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
Do you want to look for the values in column A in column F and return a value, if there is a match, from column G?
 
Upvote 0
Try:

=VLOOKUP("*"&RIGHT(A3,4),$F$3:$G$12&"",2,0)
with Control+Shift+Enter.

Or:

=LOOKUP(2^15,FIND(RIGHT(A3,4),$F$3:$F$12),$G$3:$G$12)

if you don't want to use Control+Shift+Enter. Put IFERROR around either one if you don't want to see #N/A for no matches.
 
Upvote 0
Try:

=VLOOKUP("*"&RIGHT(A3,4),$F$3:$G$12&"",2,0)
with Control+Shift+Enter.

Or:

=LOOKUP(2^15,FIND(RIGHT(A3,4),$F$3:$F$12),$G$3:$G$12)

if you don't want to use Control+Shift+Enter. Put IFERROR around either one if you don't want to see #N/A for no matches.


https://www.dropbox.com/s/pdr5qxcqfnjjxy0/DD.xlsx?dl=0
https://www.dropbox.com/s/vpptmotnnuz6x71/MM.PNG?dl=0

Thank for your help. Formula working fine but if blanks column A3 value return something.

Please assist me.
 
Upvote 0
Modifying Eric's formulas a little ..


Book1
ABCDEFG
1
2CODERESULTCODETYPE
33187K16K1610000318716KPY
43196K16K1610000319616KPY
53135K18K1810000313518KPY
6NONE10000320618KPY
7NONE10000285318KPY
83208K18K1810000320818KPY
93206K18K1810000313918KPY
103139K18K1810000315418KPY
113154K18K1810000315918KPY
123159K18K1810000321316KPY
133199
143133
Lookup
Cell Formulas
RangeFormula
C3=IFERROR("K"&LEFT(LOOKUP(2^15,FIND(RIGHT(A3,4),$F$3:$F$12),$G$3:$G$12),2),"")
B3{=IFERROR("K"&LEFT(VLOOKUP("*"&RIGHT(A3,4),$F$3:$G$12&"",2,0),2),"")}
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0
Modifying Eric's formulas a little ..

ABCDEFG
1
2CODERESULTCODETYPE
33187K16K1610000318716KPY
43196K16K1610000319616KPY
53135K18K1810000313518KPY
6NONE10000320618KPY
7NONE10000285318KPY
83208K18K1810000320818KPY
93206K18K1810000313918KPY
103139K18K1810000315418KPY
113154K18K1810000315918KPY
123159K18K1810000321316KPY
133199
143133

<colgroup><col style="width: 25pxpx"><col><col><col><col><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Lookup

Worksheet Formulas
CellFormula
C3=IFERROR("K"&LEFT(LOOKUP(2^15,FIND(RIGHT(A3,4),$F$3:$F$12),$G$3:$G$12),2),"")

<thead>
</thead><tbody>
</tbody>

<tbody>
</tbody>

Array Formulas
CellFormula
B3{=IFERROR("K"&LEFT(VLOOKUP("*"&RIGHT(A3,4),$F$3:$G$12&"",2,0),2),"")}

<thead>
</thead><tbody>
</tbody>
Enter without the {} but confirm with Ctrl+Shift+Enter, not just Enter
If entered correctly, Excel will insert the {}

<tbody>
</tbody>

Thanks for your reply and help. When lookup range is blank formula return the value.

Please look at column A15 is blank but both formula return is K16

How to resolve the issue?
 
Upvote 0
Please look at column A15 is blank but both formula return is K16
Sorry, I missed that in your image.

=IF(A3="","",IFERROR("K"&LEFT(VLOOKUP("*"&RIGHT(A3,4),$F$3:$G$12&"",2,0),2),"")) (Ctrl+Shift+Enter)

=IF(A3="","",IFERROR("K"&LEFT(LOOKUP(2^15,FIND(RIGHT(A3,4),$F$3:$F$12),$G$3:$G$12),2),""))


BTW, best not to fully quote long posts as it makes the thread harder to read/navigate and just occupies storage space needlessly. If you want to quote, quote small, relevant parts only.
 
Last edited:
Upvote 0
Sorry, I missed that in your image.

=IF(A3="","",IFERROR("K"&LEFT(VLOOKUP("*"&RIGHT(A3,4),$F$3:$G$12&"",2,0),2),"")) (Ctrl+Shift+Enter)

=IF(A3="","",IFERROR("K"&LEFT(LOOKUP(2^15,FIND(RIGHT(A3,4),$F$3:$F$12),$G$3:$G$12),2),""))


BTW, best not to fully quote long posts as it makes the thread harder to read/navigate and just occupies storage space needlessly. If you want to quote, quote small, relevant parts only.

Thank you so much for your help, formula working fine way.

Your are legend
 
Upvote 0

Forum statistics

Threads
1,221,814
Messages
6,162,135
Members
451,743
Latest member
matt3388

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