Vlookup error after database download

cgclower

New Member
Joined
Feb 28, 2010
Messages
40
I have a vlookup formula that references a range on another sheet that gets information downloaded into it from an Access database when the file opens.
<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p> </o:p>
My formula is correct, but I get an #N/A error anyway. The only way I can fix it is to manually click into the target cell and get the curser in there. Then the formula works fine. That is, it works fine until I close and reopen the sheet, at which point the download happens again and the error returns.
<o:p> </o:p>
Why? How can I make this go away?
<o:p> </o:p>
Thanks!
<o:p> </o:p>
Formula in cell B1: =VLOOKUP(A1,'OtherSheet'!C:D,2,FALSE),
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
cgclower,


Formula in cell B1: =VLOOKUP(A1,'OtherSheet'!C:D,2,FALSE)


See Excel Help for VLOOKUP.


Try filling in the rows in the range:

=VLOOKUP(A1,'OtherSheet'!C1:D100,2,FALSE)
 
Upvote 0
Tried that, didn't work.

Also tried messing around with the format of the cells (number vs text vs general, etc). Nothing.

Thanks for the help though!
 
Upvote 0
i think your data in other sheets not formatted as number
try this steps:
1)select data in column C
2)then from data tab , choose text to columns
3)just press finish

then try your formula
 
Upvote 0
cgclower,


Excel Workbook
CD
11A
22B
33C
44D
55E
66F
77G
88H
99I
1010Bingo!!!
1111K
1212L
13
OtherSheet





Excel Workbook
AB
110Bingo!!!
2
Sheet2





If the above is not helpful, then can we have some screenshots of the two worksheets?


What version of Excel are you using?

You will generally get much more help (and faster) in this forum if you can post your small samples (what you have and what you expect to achieve) directly in the forum.

To attach screenshots, see below in my Signature block: Post a screen shot with one of these:
 
Upvote 0
Tried that, didn't work.

Also tried messing around with the format of the cells (number vs text vs general, etc). Nothing.

Thanks for the help though!

See the recipe Yahya posted...

If the text number assumption is correct, the following...

=VLOOKUP(A1&"",'OtherSheet'!C:D,2,FALSE)

if it works, would support that.
 
Upvote 0
I have had this problem with data from sources outside excel. The solution I found via this board is to run this code over the data range.

Selection.value = Selection.value

Regards

Brad
 
Upvote 0
cgclower,

If none of the ideas above work, then can we have some screenshots of your two worksheets?


What version of Excel are you using?

You will generally get much more help (and faster) in this forum if you can post your small samples (what you have and what you expect to achieve) directly in the forum.

To attach screenshots, see below in my Signature block: Post a screen shot with one of these:
 
Upvote 0
Thank you all for the fantastic suggestions! The problem is indeed the fact that the data in the destination cells comes from Access. Consulting with some people I know who are quite familiar with the situation (benefits of living in Seattle), apparently it is just a bug/quirk in Excel. All kinds of lookups (including offset/match formulas) will react the same way.
<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p>
The solution I went with is the one Yahya gave: I just added a line of code after the Access import populates the sheet to run text-to-columns:
<o:p></o:p>
Code:
Columns("C:C").TextToColumns Destination:=Range("C1")
<o:p></o:p>
Works great!
<o:p></o:p>
Thanks again to everyone for the help!
 
Upvote 0

Forum statistics

Threads
1,224,590
Messages
6,179,762
Members
452,940
Latest member
rootytrip

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