![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Guest
Posts: n/a
|
I am trying to compare two lists of data, each containing client names.
I want to set a function that tests to see if a name in Col B appears in Col F. So far, I've got this formula: =IF(MATCH(B8,$F$8:$F$186,0),"Y","N") It works when the exact match is found, but if no match is found it returns #N/A. Clearly my IF statement isn't working. Any ideas on where I'm going wrong? |
|
|
|
#2 | |
|
MrExcel MVP
Join Date: Feb 2002
Location: The Hague
Posts: 50,314
|
Quote:
=IF(ISNUMBER(MATCH(B8,$F$8:$F$186,0)),"Y","N") or simpler: =IF(COUNTIF($F$8:$F$186,B8),"Y","N") |
|
|
|
|
|
|
#3 |
|
Guest
Posts: n/a
|
Thank you - both options worked a treat!
|
|
|
|
#4 |
|
New Member
Join Date: Sep 2004
Posts: 1
|
=IF(MATCH(B8,$F$8:$F$186,0),"Y","N") <--------this is wrong
=IF(ISNA(MATCH(B8,$F$8:$F$186,0), "N", "Y") <------try this.... See wat happens is that.......when you use match function........if match doesnt not find the value......it will show #NA error.....so wat i have done is the....i use the ISNA() function that return "True" if the error is #Na else false. I hope u got the idea....go try it......i have not test this in the database.....i hope it works............if not........u can ask me again..... Programing is my Nick Name |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|