Problem with Vlookup in Excel

  • Thread starter Thread starter keeno
  • Start date Start date
K

keeno

Please help this beginner! I export a Foxpro database to an Excel
spreadsheet. In a separate (job quote) spreadsheet I try to match a quote
number to it's corresonding row in the exported spreadsheet and fill in cells
in the quote sheet. What I get is #N/A. If I format the column in the
exported spreadsheet as either a number with no decimal places, or
General--the problem persists. But if I re-type the number (in the exported
spreadsheet) the number goes from left justified to right justified and now
the Vlookup formula in the quote sheet works. The exported spreadsheet grows
daily and I'd like to be able to find an automated way to use that data. Why
do I have to re-type the info?
 
Hi

In exported table, the field is text, i.e values there are interpreted as
strings like "12345". In other sheet, you entered numbers, like 12345. For
Excel, those are different values and don't equal.

Possible solutions:
a) modify the query from dbf-table, so that numeric string in this column is
converted to number;
b) modify another sheet, so that instead numbers numeric strings are in
according column;
c) or change the VLOOKUP formula like
=VLOOKUP("" & SearchValue, RangeToSearch, ColumnNum,0)

PS. For a) or b), I advice to format the leftmost column as Text, and then
requery. Otherwise whenever you happen to activate edit mode in any cell in
this column (double-clicking on it or pressing F2), the value there is
converted to number, and you get #N/A again.
 
Format all to General.

Copy an empty cell.

Select the range of bogus numbers abd Edit>Paste Special>Add>OK>Esc.


Gord Dibben MS Excel MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top