Returning Values from a Table

G

Guest

I have a spreadsheet that has payroll totals by each employee and by
department.

I created a table cross-referencing the department code to the position,
supervisor, and location.

I wanted to be able to run the spreadsheet each month, correlate it to the
table and have the information from the table populate based on the
department code. I tried to do this with VLOOKUP but the departments can be
numerical or alphanumeric.

The numeric with 6 digits work and the alphanumeric work. However, when the
numeric go to eight digits, it pulls the description from the highest six
digit department.

For example 55102101 pull from 714043.

I've tried changing the formats between numeric and text but can't get it to
work. Any ideas?
 
G

Gord Dibben

What does your VLOOKUP formula look like? Post an example.

Excel doesn't care if your lookup value is text or numeric.

Also the number of digits in the lookup value should have no bearing upon the
outcome.

I would use =VLOOKUP(value,table,column,FALSE)

Some forms of VLOOKUP formulas will return a "closest match"


Gord Dibben MS Excel MVP
 
G

Guest

I was not putting the false portion in.

VLOOKUP(value, table, column)

When I add the false statement, the all numerics work but not the
alphanumerics.
 
G

Guest

Figured it out. I had a space at the end of the alphanumerics in the
spreadsheet and not in the table. Looks like it works now. I am checking.

Thanks
 
G

Gord Dibben

That was to be my next suggestion....check for extraneous spaces.

You will probably get good results now.

Gord

Figured it out. I had a space at the end of the alphanumerics in the
spreadsheet and not in the table. Looks like it works now. I am checking.

Thanks

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

Top