XLOOK formula giving correct result 90% of the time need it to tell me if there is more than one

i0mega

New Member
Joined
Apr 4, 2009
Messages
32
Office Version
  1. 365
Platform
  1. Windows
I have this formula to tell me the number of a school , when I put part of the name in G2.
Number is in E, school in F.
I need it to tell me if there is more than 1 if possible. ie I have Schoolname Infant, Schoolname Junior, Schoolname High. At the moment it is giving me the first one.

=XLOOKUP(G2&"*",F2:F500,E2:E500,,2)

Thank you
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
You could use something like:

Excel Formula:
=IF(COUNTIF(F2:F500,G2&"*")>1,"Multiple matches",XLOOKUP(G2&"*",F2:F500,E2:E500,,2))

or you could use something like TEXTJOIN to return them all?
 
Upvote 0
This is brilliant thank you that work great. I am interested adding the text join, how would I do that?
 
Upvote 0
You could use something like this:

Excel Formula:
=TEXTJOIN(",",,FILTER(E2:E500,LEFT(F2:F500,LEN(G2))=G2,"No matches"))
 
Upvote 0
Solution
Thats just perfect, thank you so much - is there a solved button, I cant find one?
 
Upvote 0
Glad we could help. :) (looks like you figured out the Solved issue)
 
Upvote 0

Forum statistics

Threads
1,215,147
Messages
6,123,297
Members
449,095
Latest member
Chestertim

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