LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 38
Default vlookup returns #N/A if value contains letters and range numbe

Thanks Dave. I was at my wits end trying to figure out the problem. thanks a
million!

"Dave Peterson" wrote:

That's what this warning was for:
Adjust the range to match--but you can't use the whole column.
<vbg

Choose a range large enough so you don't have to worry. Then make that
reference absolute:

=INDEX($C$1:$C$1000,MATCH(LEFT(B2,10)&"*",""&$C$1: $C$1000,0))

The larger the number of rows, the safer you'll be--but the slower the
recalculation, too. So use a number as large as you need, but no larger <vvbg.

checkQ wrote:

Thanks Dave. I loved your last 2 formulas for the problem.
I was trying to subsitute C1:C100 with C:C but it would not work. As I copy
the formula down C1:C100 change to C2:c101,C3:c102 ect any solutions?
Mark

"Dave Peterson" wrote:

You can use wildcards in =vlookup().

And if the values in column C are longer than 10 characters, this formula won't
work the way the OP intended (as I read it).



Pete_UK wrote:

I am surprised that this works at all, as your final parameter of the
VLOOKUP is zero, indicating that you want an exact match - you can't
use * as a wildcard. Also, your lookup array is C:D, but you only want
to return from column 1, so the array could be C:C.

The LEFT function will return a text value, so you must ensure that all
the entries in column C are text values - the way it stands, 1102900068
would be interpreted as numeric, so you won't find an exact match.
Highlight column C and click Format | Cells | Number (tab) and select
Text. Then change your formula to:

=VLOOKUP(LEFT(B1,10),C:C,1,0)

and ensure that all your values in column C are 10 characters long.

Hope this helps.

Pete

checkQ wrote:
A B C
040W02193A 040W02193A0B 040W02193A
#N/A 1 1028600680B 1102900068


Formula used in column A is=VLOOKUP(LEFT(B1,10)&"*",C:D,1,0)

The value that I am looking for is in the first 10 characters in column B
that match the first 10 characters in column C

The formula works for the first line but returns an #N/A for the second
line
I believe it is because my column B has the letter B in it and column C does
not have any alphabet. Does anyone know a formula to fix this?.

--

Dave Peterson


--

Dave Peterson

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
sort a range of numbers ignoring preceding letters j0hnt52 Excel Discussion (Misc queries) 1 April 17th 06 04:04 AM
Convert letters into numbers. i.e. ABCD = 52 Rhapsody 1234 Excel Worksheet Functions 8 December 9th 05 07:33 PM
Range names are displaying in big blue letters on sheet Katie Excel Discussion (Misc queries) 4 November 1st 05 10:43 PM
VLOOKUP Limitations chris_manning Excel Worksheet Functions 2 August 9th 05 06:23 PM
how to sum up letters instead of numbers? Iviio Excel Discussion (Misc queries) 4 December 27th 04 12:22 AM


All times are GMT +1. The time now is 10:30 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"