Help with VLOOKUP and LEFT functions

Sean15

Well-known Member
Joined
Jun 25, 2005
Messages
698
Office Version
  1. 2010
Platform
  1. Windows
Hi:


Excel 2010
BCDEFG
2101203Cash#N/A101Assets
3101205Cash Equiv#N/A102..Liab
4102207Intangible#N/A103Revenue
5102125Accounts payable#N/A104Exp
6103129Billing#N/A105Equity
7103131Billing2#N/A
8104135Salary#N/A
9104137Rent#N/A
10105614Equity#N/A
Sheet1
Cell Formulas
RangeFormula
D2=VLOOKUP(VALUE(LEFT(B2,3)),$F$2:$G$6,2,0)
D3=VLOOKUP(VALUE(LEFT(B3,3)),$F$2:$G$6,2,0)
D4=VLOOKUP(VALUE(LEFT(B4,3)),$F$2:$G$6,2,0)
D5=VLOOKUP(VALUE(LEFT(B5,3)),$F$2:$G$6,2,0)
D6=VLOOKUP(VALUE(LEFT(B6,3)),$F$2:$G$6,2,0)
D7=VLOOKUP(VALUE(LEFT(B7,3)),$F$2:$G$6,2,0)
D8=VLOOKUP(VALUE(LEFT(B8,3)),$F$2:$G$6,2,0)
D9=VLOOKUP(VALUE(LEFT(B9,3)),$F$2:$G$6,2,0)
D10=VLOOKUP(VALUE(LEFT(B10,3)),$F$2:$G$6,2,0)



I believe VLOOKUP is returning #NA because of the "..." in the lookup range but I am not allowed to make changes to column F.

Could you take a look please?


Regards,

Sean
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
Hi,

There might be other ways, here's a CSE INDEX/MATCH:


Excel 2010
BCDEFG
2101203CashAssets101Assets
3101205Cash EquivAssets102..Liab
4102207IntangibleLiab103Revenue
5102125Accounts payableLiab104Exp
6103129BillingRevenue105Equity
7103131Billing2Revenue
8104135SalaryExp
9104137RentExp
10105614EquityEquity
Sheet16
Cell Formulas
RangeFormula
D2{=INDEX(G$2:G$6,MATCH(LEFT(B2,3),LEFT(F$2:F$6,3),0))}
Press CTRL+SHIFT+ENTER to enter array formulas.


D2 formula copied down.
 
Upvote 0
Hi:

I believe VLOOKUP is returning #NA because of the "..." in the lookup range but I am not allowed to make changes to column F.

Could you take a look please?

Regards,

Sean

Hi!

Try this too:

=VLOOKUP(LEFT(B2,3)&"...",$F$2:$G$6,2,0)<strike></strike>

Or

=LOOKUP(LEFT(B2,3),LEFT($F$2:$F$6,3),$G$2:$G$6)

Markmzz
 
Last edited:
Upvote 0
Thank you very much.

Is there a way to use INDEX and MATCH without CSE? If not, I'll go LOOKUP formula.

Regards,

Sean
 
Upvote 0
Thank you very much.

Is there a way to use INDEX and MATCH without CSE? If not, I'll go LOOKUP formula.

Regards,

Sean

Yes, forgot about using wildcards:


Excel 2010
BCDEFG
2101203CashAssets101Assets
3101205Cash EquivAssets102..Liab
4102207IntangibleLiab103Revenue
5102125Accounts payableLiab104Exp
6103129BillingRevenue105Equity
7103131Billing2Revenue
8104135SalaryExp
9104137RentExp
10105614EquityEquity
Sheet16
Cell Formulas
RangeFormula
D2=INDEX(G$2:G$6,MATCH(LEFT(B2,3)&"*",F$2:F$6,0))
 
Upvote 0
Thank you very much.

Is there a way to use INDEX and MATCH without CSE? If not, I'll go LOOKUP formula.

Regards,

Sean

If those ... are real, that would indicate text values in F. In that case, a VLOOKUP with the * wildcard would simply work (see post #4 ).
 
Upvote 0
Yep, I'll settle for the simple VLOOKUP with * wildcard and I have added INDEX and MATCH with wildcard to my cheat sheet.

Thanks for your help.

Regards,

Sean
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,427
Messages
6,124,830
Members
449,190
Latest member
rscraig11

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