Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 310
Default Vlookup derived wrong value

Formula used for LastMthCost is =vlookup(A2,LastMthCost!A2:B3,2,FALSE)
Instead of returning 1.5 but i got 2.5!!!!! Please help

Worksheet: ThisMthCost
A B
1 PartNum LastMthCost
2 M03541224*a 2.5

Worksheet: LastMthCost
A B
1 PartNum LastMthCost
2 M03541224**a 2.5
3 M03541224*a 1.5





  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default Vlookup derived wrong value

The problem is that Excel is interpreting the * as a wildcard character.
Based on your limited sample this array formula** will work:

=INDEX(LastMthCost!B2:B3,MATCH(TRUE,EXACT(A2,LastM thCost!A2:A3),0))

** array formulas need to be entered using the key combination of
CTRL,SHIFT,ENTER (not just ENTER)

Note that the EXACT function requires that a lilteral *exact* match must be
found. This means that it's case sensitive.

Using EXACT, these values will not match:

M03541224*a
M03541224*A
m03541224*a

--
Biff
Microsoft Excel MVP


"Michelle" wrote in message
...
Formula used for LastMthCost is =vlookup(A2,LastMthCost!A2:B3,2,FALSE)
Instead of returning 1.5 but i got 2.5!!!!! Please help

Worksheet: ThisMthCost
A B
1 PartNum LastMthCost
2 M03541224*a 2.5

Worksheet: LastMthCost
A B
1 PartNum LastMthCost
2 M03541224**a 2.5
3 M03541224*a 1.5







  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 35,218
Default Vlookup derived wrong value

Excel supports wild cards (* and ?, any set of characters and any single
character).

The tilde is used to tell excel that you don't mean the wildcard--you actually
mean that character ~* and ~?.
Since tilde has a special purpose, you have to treat it special too: ~~.

And if your data has asterisks and question marks, you may want something like:

=VLOOKUP(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A2,"~"," ~~"),"?","~?"),"*","~*"),
LastMthCost!A2:B3,2,FALSE)

Michelle wrote:

Formula used for LastMthCost is =vlookup(A2,LastMthCost!A2:B3,2,FALSE)
Instead of returning 1.5 but i got 2.5!!!!! Please help

Worksheet: ThisMthCost
A B
1 PartNum LastMthCost
2 M03541224*a 2.5

Worksheet: LastMthCost
A B
1 PartNum LastMthCost
2 M03541224**a 2.5
3 M03541224*a 1.5


--

Dave Peterson
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,718
Default Vlookup derived wrong value

Try this:
A5: is your criteria

=SUMPRODUCT(--(A1:A2=A5),B1:B2)


"Michelle" wrote:

Formula used for LastMthCost is =vlookup(A2,LastMthCost!A2:B3,2,FALSE)
Instead of returning 1.5 but i got 2.5!!!!! Please help

Worksheet: ThisMthCost
A B
1 PartNum LastMthCost
2 M03541224*a 2.5

Worksheet: LastMthCost
A B
1 PartNum LastMthCost
2 M03541224**a 2.5
3 M03541224*a 1.5





  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 310
Default Vlookup derived wrong value

Lots of thanks for all your suggestions
I had tried this particular one and it seems like working fine.

"Dave Peterson" wrote:

Excel supports wild cards (* and ?, any set of characters and any single
character).

The tilde is used to tell excel that you don't mean the wildcard--you actually
mean that character ~* and ~?.
Since tilde has a special purpose, you have to treat it special too: ~~.

And if your data has asterisks and question marks, you may want something like:

=VLOOKUP(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A2,"~"," ~~"),"?","~?"),"*","~*"),
LastMthCost!A2:B3,2,FALSE)

Michelle wrote:

Formula used for LastMthCost is =vlookup(A2,LastMthCost!A2:B3,2,FALSE)
Instead of returning 1.5 but i got 2.5!!!!! Please help

Worksheet: ThisMthCost
A B
1 PartNum LastMthCost
2 M03541224*a 2.5

Worksheet: LastMthCost
A B
1 PartNum LastMthCost
2 M03541224**a 2.5
3 M03541224*a 1.5


--

Dave Peterson

Reply
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
Vlookup - can't figure out what's wrong pm Excel Worksheet Functions 5 December 15th 06 08:02 PM
Office Assistance: VLOOKUP, Example 3- Row headers 1-7 are wrong? Skydiver Excel Worksheet Functions 0 September 27th 06 08:44 PM
vlookup, what am I doing wrong? ufo_pilot Excel Discussion (Misc queries) 3 August 9th 05 05:36 PM
VLOOKUP returning wrong row jthomas Excel Worksheet Functions 6 August 3rd 05 10:32 PM
What wrong with VLOOKUP formula TARZAN Excel Worksheet Functions 2 January 31st 05 10:09 PM


All times are GMT +1. The time now is 10:19 AM.

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

About Us

"It's about Microsoft Excel"