Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Problem with Vlookup as Vlookup Range is bigger than 256 characters

Posted on 2013-11-18
5
Medium Priority
?
367 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 31

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 2000 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.

885 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