Solved

Problem with Vlookup as Vlookup Range is bigger than 256 characters

Posted on 2013-11-18
5
313 Views
Last Modified: 2013-11-20
Hi Guys, I am having a problem as the "AD5" on the DummyRec6 attachment is not working as the Vlookup in "B5" is 420 characters long. Can someone suggest a solution? The other attachment is what is being VLookedup.
DummyRec6.xlsx
Murex-BS-rec-breaks---111113-KM.xlsx
0
Comment
Question by:Justincut
5 Comments
 
LVL 30

Expert Comment

by:captain
ID: 39656475
It appears that this is less of a data issue like you normally get with the 255 limit, but an operational/organisational. So the traditional INDEX workaround will not be of much help

Your lookup itself is straight forward but it becomes bloated due to your absolute path to the file location of your source data.

The obvious workaround would be to change the location of the files. Now I assume that you don't just need to do this on this one file, but on multiples in different folders.

What would be the application of the lookup? Your own use or multiple users?It does not look like you could work with a mapped drive as this won't significantly shorten the vlookups, as the file specific root starts fairly early. However is there scope to shortening the path by changing folder names?

Ultimately you may want to consider some form of 'localising' the file, either through a mapped drive or a true local copy, as your solution at the moment has a quite obvious pratical inconvenience: Your formula relates to a current month, so you will need to change this every time the month or the file location changes.

However all that being said you may be able to live with a simple trick:
Create one or more new tabs and simply point the cells there to the relevant cell in the source file, like
='V:\T....'

Open in new window


That way you create a carbon copy of the file locally in your workbook, but it does not give you much flexibility for months, file locations etc. That would still be a manual change each time..

hth
capt.
0
 
LVL 23

Expert Comment

by:NBVC
ID: 39656484
What happened to the UDF that we worked on here?

Your other thread
0
 
LVL 43

Expert Comment

by:Saqib Husain, Syed
ID: 39656512
The string in both files should be identical. This is not the case in the given files. So you would not get the match. This is not a 255 char limit problem.
0
 

Author Comment

by:Justincut
ID: 39656606
Sorry Chaps, I have put the Vlookup to another tab in the DummyRec attachment here to illustrate my problem. In the AD column on the "Rec" tab, I am getting a VALUE error message. Any ideas in combatting this problem?
DummyRec6.xlsx
0
 
LVL 23

Accepted Solution

by:
NBVC earned 500 total points
ID: 39656651
If you use the function from your previous thread,

Function MyVlookup(Lval As Range, c As Range, oset As Long) As Variant
 Dim cl As Range
 For Each cl In c.Columns(1).Cells
     If UCase(Lval) = UCase(cl) Then
         MyVlookup = cl.Offset(, oset - 1)
         Exit Function
     End If
     Next
 End Function

Open in new window


and apply formula

=IF(ISNA(myVlookup($B5,'Prev Day'!$B:$AL,AD$1)),IF($J5="","NEW",IF(ISNA(myVlookup($C5,'Prev Day'!$C:$AL,AD$1-1)),"NEW",myVlookup($C5,'Prev Day'!$C:$AL,AD$1-1))),myVLOOKUP($B5,'Prev Day'!$B:$AL,AD$1))

Then you get 0 which means no matches found with this function.

Again, though, it is recommended you reduce the range sizes because this will be a slow process.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Approximate matching with VLOOKUP and MATCH seems to me to be a greatly under-used technique, and one which is vital for getting good performance out of large lookups. Until recently I would always have advised using an exact match for simplicity an…
This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
The viewer will learn how to simulate a series of sales calls dependent on a single skill level and learn how to simulate a series of sales calls dependent on two skill levels. Simulating Independent Sales Calls: Enter .75 into cell C2 – “skill leve…
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now