Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2
Default VLOOKUP gives duplicate results for "empty" searches

I'm doing a search of a table with a unique transaction code (column
A) and its corresponding description (column B). The table doesn't
have all of the transaction codes in place yet, when compared to the
actual transactions in use (which I'm trying to populate with the
description). When the transaction code matches, the description
comes over. When the transaction code cannot be found, the
description from the previous line is populated.

=VLOOKUP(A2,TranIndex!A:B,2)

Also, is there any reason the Description column MUST be in "General"
format instead of "Text"? When it's "Text" format, I get no results
(no idea why).

As you can tell, I'm not an Excel afficionado. I'm just hoping
somebody out there can provide an old mainframe like me some guidance.

Many thanks.

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,856
Default VLOOKUP gives duplicate results for "empty" searches

There is an optional fourth parameter which can be used with VLOOKUP
to indicate if you want an exact match. The parameter is set to FALSE
or 0 if this is the case (which is what you want). Consequently, you
should amend your formula to:

=VLOOKUP(A2,TranIndex!A:B,2,0)

Unfortunately with this, if there is not an exact match in the table
the formula returns an error - #N/A, so if you don't want this to
appear you have to trap it and return something else (often this would
be 0 or "" (i.e. a blank cell). The formula is modified as follows:

=IF(ISNA(VLOOKUP(A2,TranIndex!A:B,2,0)),"",VLOOKUP (A2,TranIndex!A:B,
2,0))

Basically meaning, if the vlookup formula will generate an error code
then return a blank, otherwise let the vlookup formula return the
corresponding value from the lookup table.

Hope this helps.

Pete

On Apr 5, 1:27 am, "Doc Farmer" wrote:
I'm doing a search of a table with a unique transaction code (column
A) and its corresponding description (column B). The table doesn't
have all of the transaction codes in place yet, when compared to the
actual transactions in use (which I'm trying to populate with the
description). When the transaction code matches, the description
comes over. When the transaction code cannot be found, the
description from the previous line is populated.

=VLOOKUP(A2,TranIndex!A:B,2)

Also, is there any reason the Description column MUST be in "General"
format instead of "Text"? When it's "Text" format, I get no results
(no idea why).

As you can tell, I'm not an Excel afficionado. I'm just hoping
somebody out there can provide an old mainframe like me some guidance.

Many thanks.



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2
Default VLOOKUP gives duplicate results for "empty" searches

Your second item (the IF statement) works like a charm! Many thanks
for the assistance.


On Apr 4, 8:41 pm, "Pete_UK" wrote:
There is an optional fourth parameter which can be used with VLOOKUP
to indicate if you want an exact match. The parameter is set to FALSE
or 0 if this is the case (which is what you want). Consequently, you
should amend your formula to:

=VLOOKUP(A2,TranIndex!A:B,2,0)

Unfortunately with this, if there is not an exact match in the table
the formula returns an error - #N/A, so if you don't want this to
appear you have to trap it and return something else (often this would
be 0 or "" (i.e. a blank cell). The formula is modified as follows:

=IF(ISNA(VLOOKUP(A2,TranIndex!A:B,2,0)),"",VLOOKUP (A2,TranIndex!A:B,
2,0))

Basically meaning, if the vlookup formula will generate an error code
then return a blank, otherwise let the vlookup formula return the
corresponding value from the lookup table.

Hope this helps.

Pete

On Apr 5, 1:27 am, "Doc Farmer" wrote:



I'm doing a search of a table with a unique transaction code (column
A) and its corresponding description (column B). The table doesn't
have all of the transaction codes in place yet, when compared to the
actual transactions in use (which I'm trying to populate with the
description). When the transaction code matches, the description
comes over. When the transaction code cannot be found, the
description from the previous line is populated.


=VLOOKUP(A2,TranIndex!A:B,2)


Also, is there any reason the Description column MUST be in "General"
format instead of "Text"? When it's "Text" format, I get no results
(no idea why).


As you can tell, I'm not an Excel afficionado. I'm just hoping
somebody out there can provide an old mainframe like me some guidance.


Many thanks.- Hide quoted text -


- Show quoted text -



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,856
Default VLOOKUP gives duplicate results for "empty" searches

Thanks for feeding back - glad to be of help.

Pete

On Apr 5, 1:59 am, "Doc Farmer" wrote:
Your second item (the IF statement) works like a charm! Many thanks
for the assistance.

On Apr 4, 8:41 pm, "Pete_UK" wrote:



There is an optional fourth parameter which can be used with VLOOKUP
to indicate if you want an exact match. The parameter is set to FALSE
or 0 if this is the case (which is what you want). Consequently, you
should amend your formula to:


=VLOOKUP(A2,TranIndex!A:B,2,0)


Unfortunately with this, if there is not an exact match in the table
the formula returns an error - #N/A, so if you don't want this to
appear you have to trap it and return something else (often this would
be 0 or "" (i.e. a blank cell). The formula is modified as follows:


=IF(ISNA(VLOOKUP(A2,TranIndex!A:B,2,0)),"",VLOOKUP (A2,TranIndex!A:B,
2,0))


Basically meaning, if the vlookup formula will generate an error code
then return a blank, otherwise let the vlookup formula return the
corresponding value from the lookup table.


Hope this helps.


Pete


On Apr 5, 1:27 am, "Doc Farmer" wrote:


I'm doing a search of a table with a unique transaction code (column
A) and its corresponding description (column B). The table doesn't
have all of the transaction codes in place yet, when compared to the
actual transactions in use (which I'm trying to populate with the
description). When the transaction code matches, the description
comes over. When the transaction code cannot be found, the
description from the previous line is populated.


=VLOOKUP(A2,TranIndex!A:B,2)


Also, is there any reason the Description column MUST be in "General"
format instead of "Text"? When it's "Text" format, I get no results
(no idea why).


As you can tell, I'm not an Excel afficionado. I'm just hoping
somebody out there can provide an old mainframe like me some guidance.


Many thanks.- Hide quoted text -


- Show quoted text -- Hide quoted text -


- Show quoted text -



  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
CLR CLR is offline
external usenet poster
 
Posts: 594
Default VLOOKUP gives duplicate results for "empty" searches

Try this.........

=IF(ISNA(VLOOKUP(A2,TranIndex!A:B,2,False)),"Not
found",VLOOKUP(A2,TranIndex!A:B,2,False))

.....all on one line, watch out for word-wrap.

Vaya con Dios,
Chuck, CABGx3



"Doc Farmer" wrote in message
oups.com...
I'm doing a search of a table with a unique transaction code (column
A) and its corresponding description (column B). The table doesn't
have all of the transaction codes in place yet, when compared to the
actual transactions in use (which I'm trying to populate with the
description). When the transaction code matches, the description
comes over. When the transaction code cannot be found, the
description from the previous line is populated.

=VLOOKUP(A2,TranIndex!A:B,2)

Also, is there any reason the Description column MUST be in "General"
format instead of "Text"? When it's "Text" format, I get no results
(no idea why).

As you can tell, I'm not an Excel afficionado. I'm just hoping
somebody out there can provide an old mainframe like me some guidance.

Many thanks.





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
Data entry "+" results in "294" in XLS jaak de vuyst Excel Discussion (Misc queries) 1 October 22nd 06 06:18 PM
problems with displaying "duplicate vlookup values" in same column p CAST Excel Discussion (Misc queries) 7 August 7th 06 06:24 PM
HELP on "left","right","find","len","substitute" functions serene83 Excel Discussion (Misc queries) 5 June 27th 06 02:23 AM
Count occurences of "1"/"0" (or"TRUE"/"FALSE") in a row w. conditions in the next BCB New Users to Excel 7 May 13th 06 10:02 PM
Sorting Formulas with "Empty" Results Access n00b Excel Worksheet Functions 1 March 27th 06 12:06 AM


All times are GMT +1. The time now is 03:52 AM.

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"