Thread: Vlookup Problem
View Single Post
  #3   Report Post  
Dave Peterson
 
Posts: n/a
Default

Since you're working with numbers, my guess is that some of your numbers are
really numbers and some of your numbers are text (masquerading as numbers).

Say you look at your worksheet and you see that A2 "matches" C7 (just by
looking), you can check if they're both numbers with a couple of formulas in
unused cells:


=isnumber(a2)
and
=isnumber(c7)

If they both come back with true or False, then they are the same.

Then try:
=a2=c7

If that comes back as false, then look for trailing spaces in one of the cells.

==
My personal preference is to correct the data in both spots--decide to use Text
numbers or number numbers.

One way to convert Text numbers to number numbers is to select an empty cell,
copy it.
select your offending range and then
edit|paste special|check Add.

I'd do that for both column A and column C to make sure both were really
numbers. (You can give each column a custom format of "0000" to show all 4
digits.)

========
Now some thoughts you didn't ask about.

I like to keep my tables on a dedicated worksheet. It makes inserting/deleting
rows much easier--both in the table and in the "data".

And =vlookup() is usually used to return a value that is in a separate column in
that table (when the key matches).

Excel has another function to test for existance in a single column or row:
=match()

You can use it like:

=if(isnumber(match(a1,sheet2!a:a,0)),"Found it","not found")
or you can check for an error to do the same thing:
=if(iserror(match(a1,sheet2!a:a,0)),"Not found","Found")

You may be able to simplify some of your formulas.



Trying to excel in life but need help wrote:

I have 4 columns of data and two columns where information is entered. All
information is 4 digit # e.g. 2222.

Column A is where the deployment pool numbers are entered
Column B is where items to be repaired are entered

Column C is the source data for the pool numbers.

Column D is the ready pool -waiting to be deployed. This is identical to
column C unless pool numbers are entered in A or B

Column E is the Vlookup Formula for the Deployment Pool Numbers.

Column F is the Vlookup Formula for the Repair Pool Numbers.

I am using this formula. Assuming that all items are in the D Column unless
numbers are enter into A or B then the cell for D column would equal the
value in the adjacent cell in the source C column.

Formula in D is:
=IF(VLOOKUP(A5,C5:C9,1,FALSE),IF(VLOOKUP(B5,C5:C9, 1,FALSE),C5))

Formula in E is:
=VLOOKUP(A5,C5:C9,1,FALSE)

Formula in F is:
=VLOOKUP(B5,C5:C9,1,FALSE)

I am getting and #N/A error when there is not a value in A5 or B5. I want
the value in D5 to be that same as in C5. What am I doing wrong?

Thank you for the help.
Martin


--

Dave Peterson