Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
The values are literal strings... item numbers. They should not be referring
to any other cells. I've simplified the example of my problem, and it's giving the same result. In a new workbook, with only one sheet, I've entered these contents: A1: List A2: a A3: a*BB*c A4: c B1: a*b*c C1: =VLOOKUP(B1,tblList,1,FALSE) Cells A1 to A4 are given the range name, tblList the value in B1 is not in the list, yet C1 is returning a match, the value in cell A3. I need it NOT to do that. Thanks for looking at it. "Sheeloo" wrote: I put 61*080*C51*022 in A1 and 61*80*C51*022 in C1 Entered the following formula in B1 =VLOOKUP(A1,C:C,1,FALSE) The result (as expected) I got was #N/A Does C51 refer to a cell containing numbers... Is the value in A1 or C1 being treated as a formula? If I put a = sign in front of A1 and C1 and put a number in C51 then I have identical values in both A1 & C1 "mark" wrote: I have two item numbers: 61*80*C51*022 in a list of item numbers, tblList 61*080*C51*022 in a single cell, call it a1 the function =vlookup(a1,tblList,1,0) is returning a match on that. they are not identical... one is *80* , the other is *080* . I think it's because of a wildcard search that it's calling it a match? I need it to be able to distinguish the difference. It's causing my report to be wrong. Help? thanks. |
#2
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
The purpose of my quest is this... I have two lists of item numbers, most of
which are the same. But, I need to add any item numbers that are in the second list, but not the first, to the first, to get a unique list from the entire set. I've thought of a way to handle this. The problem, as is, is that: a*b*c is finding the match: a*BB*c when I don't want that to be a match. I think it's using a regular expression logic to find a pattern match... read it as anthing b anything, and that matches anything BB anything. But, the lengths are different. If I put in a check to see that the length on the item found in the list, is the same as the length of the item searched for, it will eliminate my problem. but I still wish it was at least an option as to whether you want it to do wild card searches or not. I've further proved the problem by replacing the contents of cell A3 with the word: Northeast and cell B1 with: *east The formula in cell C1, =VLOOKUP(B1,tblList,1,FALSE) returns a match: Northeast That could be very useful IF that's what I wanted it to do. As is, it's mildly annoying. |
#3
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
I get the same issue. If you search for the *080* one, you won't find. But if
you search for *80* you DO get a match. It appears VLOOKUP is counting the * as a wildcard search. I tried entering an ' prior to the value and that di not resolve it. This is a puzzler. "mark" wrote: The values are literal strings... item numbers. They should not be referring to any other cells. I've simplified the example of my problem, and it's giving the same result. In a new workbook, with only one sheet, I've entered these contents: A1: List A2: a A3: a*BB*c A4: c B1: a*b*c C1: =VLOOKUP(B1,tblList,1,FALSE) Cells A1 to A4 are given the range name, tblList the value in B1 is not in the list, yet C1 is returning a match, the value in cell A3. I need it NOT to do that. Thanks for looking at it. "Sheeloo" wrote: I put 61*080*C51*022 in A1 and 61*80*C51*022 in C1 Entered the following formula in B1 =VLOOKUP(A1,C:C,1,FALSE) The result (as expected) I got was #N/A Does C51 refer to a cell containing numbers... Is the value in A1 or C1 being treated as a formula? If I put a = sign in front of A1 and C1 and put a number in C51 then I have identical values in both A1 & C1 "mark" wrote: I have two item numbers: 61*80*C51*022 in a list of item numbers, tblList 61*080*C51*022 in a single cell, call it a1 the function =vlookup(a1,tblList,1,0) is returning a match on that. they are not identical... one is *80* , the other is *080* . I think it's because of a wildcard search that it's calling it a match? I need it to be able to distinguish the difference. It's causing my report to be wrong. Help? thanks. |
#4
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
It appears VLOOKUP is counting the * as a wildcard search.
Right, it is. I did just find in the help where it says it's going to do that. It explains that in the Remarks section, and says you can use a tilde ~ in front of the * to sell it not to do that. But, I can't change my original data before doing the lookup. Working with another person here, we've come up with a formula to tell it to do an exact match on both * and ? =SUBSTITUTE(SUBSTITUTE(C1,"*","~*"),"?","~?") where the value to be looked up is in C1. This whole thing goes into a piece of VBA code, so the " is going to need to be "" . That should be 'pretty'. But I can do it. Thanks. |
#5
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
I don't know what changed but I could replicate the issue now.
* is being taken as a wild card... I replaced all *s with $s and did NOT get the match as expected... Can you remove all * in your lookup table? I don't think so but if you can then you can use someting like; =VLOOKUP(SUBSTITUTE(A3,"*",""),A1:A10,1,FALSE) I will post again if I find a solution. "mark" wrote: The values are literal strings... item numbers. They should not be referring to any other cells. I've simplified the example of my problem, and it's giving the same result. In a new workbook, with only one sheet, I've entered these contents: A1: List A2: a A3: a*BB*c A4: c B1: a*b*c C1: =VLOOKUP(B1,tblList,1,FALSE) Cells A1 to A4 are given the range name, tblList the value in B1 is not in the list, yet C1 is returning a match, the value in cell A3. I need it NOT to do that. Thanks for looking at it. "Sheeloo" wrote: I put 61*080*C51*022 in A1 and 61*80*C51*022 in C1 Entered the following formula in B1 =VLOOKUP(A1,C:C,1,FALSE) The result (as expected) I got was #N/A Does C51 refer to a cell containing numbers... Is the value in A1 or C1 being treated as a formula? If I put a = sign in front of A1 and C1 and put a number in C51 then I have identical values in both A1 & C1 "mark" wrote: I have two item numbers: 61*80*C51*022 in a list of item numbers, tblList 61*080*C51*022 in a single cell, call it a1 the function =vlookup(a1,tblList,1,0) is returning a match on that. they are not identical... one is *80* , the other is *080* . I think it's because of a wildcard search that it's calling it a match? I need it to be able to distinguish the difference. It's causing my report to be wrong. Help? thanks. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
vlookup retunrning a match, when not a match... | Excel Worksheet Functions | |||
index(match) Wind Uplift Calculations (match four conditions) | Excel Worksheet Functions | |||
second or third match in vlookup() or Match() | Excel Worksheet Functions | |||
MATCH Multiple Criteria & Return Previous / Penultimate Match | Excel Worksheet Functions | |||
index Match, or Vlookup Match.. | Excel Worksheet Functions |