Combining =left and vlookup - not working, as expected

Mr2017

Well-known Member
Joined
Nov 28, 2016
Messages
644
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
Hi

I need to limit the number of characters that I'm getting from a vlookup formula.

The current formula is

=IFERROR(IF(F3="","",VLOOKUP(F3,'Data'!E:F,2,FALSE)),"") and it brings back the right result.

But I need to add an =LEFT formula, so it only takes the first 50 characters.

I've tried this

=IFERROR(IF(F3="","",left(VLOOKUP(F3,'Data'!E:F,2,FALSE)),50,""))

But I got an error message saying

"You've entered too many arguments for this function."

I've tested using the =LEFT without the IFERROR function and it worked.

In Sheet 1 of a new workbook,

if you have the words "SKU" and "Descr" in cells A1 and B1, respectively, then the number 1234 in cell A2 (you can copy and paste the data below into those cells in Sheet 1)

[TABLE="width: 381"]
<colgroup><col><col></colgroup><tbody>[TR]
[TD]SKU[/TD]
[TD]Descr[/TD]
[/TR]
[TR]
[TD]1234[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]

Then in Sheet 2 of the same workbook, copy and past the data below into cell A1

[TABLE="width: 428"]
<colgroup><col><col></colgroup><tbody>[TR]
[TD]SKU[/TD]
[TD]Descr[/TD]
[/TR]
[TR]
[TD]1234[/TD]
[TD]Breyers Delights Chocolate Orange Crunch Ice Cream 500Ml[/TD]
[/TR]
</tbody>[/TABLE]

If you then paste this formula into cell B2 of Sheet 1, the formula will return the correct result AND limit the characters in the cell to 50 (by taking out the "ML" at the end of the description.

=LEFT(VLOOKUP(A2,Sheet2!A:B,2,FALSE),50)

So I'm baffled as to why doesn't it work in my original example with the IFERROR function above/below!?

=IFERROR(IF(F3="","",left(VLOOKUP(F3,'Data'!E:F,2,FALSE)),50,""))

Can anyone please help?
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
Hi Special K-99

When I try that formula, I still get the "You've entered too many arguments for this function" error message....

Any other ideas, please?

 
Upvote 0
This should work

=IFERROR(IF(F3="","",LEFT(VLOOKUP(F3,'Data'!E:F,2,FALSE),50)),"")
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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