Show a "Yes" or "No" result using xlookup (or similar).

Kdog64

New Member
Joined
Oct 16, 2024
Messages
3
Office Version
  1. 365
  2. 2019
Platform
  1. Windows
This has probably been asked before, apologies as am newbie to this site.

Basically I use xlookup to check if serial numbers (alphanumeric) in one spreadsheet exist in another. Instead of returning whatever I set as the return array, is there a way to just return a Yes or No result. If this is easier achieved with another function then that is ideal too.
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
Hi & welcome to MrExcel.
You could use something like
Excel Formula:
=if(isnumber(xmatch( value,range)),"Yes","No")
 
Upvote 0
Solution
Hi & welcome to MrExcel.
You could use something like
Excel Formula:
=if(isnumber(xmatch( value,range)),"Yes","No")

Fantastic! I never knew about the xmatch function. I assume it must return a 1 if the item is matched.
 
Upvote 0
If th number is matched, it will return the position of that number in the range.
 
Upvote 0
You can use the regular MATCH function too:
=IF(ISNUMBER(MATCH(A1,Sheet2!A:A,0)),"YES","NO")

although I would probably use COUNTIF:
=IF(COUNTIF(Sheet2!A:A,A1),"Yes","No")
 
Upvote 0
Thanks everyone for you help. All very interesting. Excel is so versatile and you can achieve similar results in many different ways.

I did like the countif method, I had not thought of that, but always like to read about new functions 😁
 
Upvote 0
Glad we could help & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,223,888
Messages
6,175,213
Members
452,618
Latest member
Tam84

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top