Microsoft Office Tutorials and References
In Depth Information
Figure 11.52. Spaces are padding the right side of the products in column A.
Spaces are padding the right side of the products in column A.
33. If the problem is occurring in the values being looked up, you could
modify the formula in cell B2 to use the TRIM function. The new for-
mula would be =VLOOKUP(TRIM(A2),$F$2:$G$5,2,FALSE). Figure 11.53
shows how this solves the problem.
Figure 11.53. Using
TRIM to remove leading spaces allows
to remove leading spaces allows VLOOKUP
VLOOKUP to work.
44. If the problem is occurring in the first column of the lookup table, in-
sert a new temporary column. Enter the function =TRIM(F2)
=TRIM(F2) in the tem-
porary column. Copy this formula down to all rows of the lookup
table. Copy the new formulas. Select A2. Select Home, Paste, Values
to paste the new values. Although the old and new values look the
same, the TRIM function has removed the trailing spaces, and now the