Return Cell references of specific text in range

glynn1969

Board Regular
Joined
Nov 24, 2018
Messages
80
Office Version
  1. 365
Platform
  1. Windows
Hello i will try to keep my query simple.

I have a tab called Data and in column A i have 1000's of surnames (in no particular order).

i would like to be able to enter a search text in cell d2 and then next my search box (so in e2 and across - to then return ALL the cell references that contain that surname - eg it may show A12 A432 A634 A6443

i can do this to return the first occurrence of the surname but can't seem to get all occurrences displayed as a list.

Is this possible.

Thank you in advance
 
Last edited:
Perhaps:

Book1
ABCDEFGH
1NamesSearch
2AppleAppleA2A9A10A11
3Bonnie
4Carol
5Dave
6Egg
7Friend
8Ghee
9Apple
10Apple
11Apple
12Bonnie
13Bonnie
14Egg
15Egg
16Egg
Sheet1
Cell Formulas
RangeFormula
E2:H2E2=TOROW("A"&FILTER(ROW(A2:A16),A2:A16=D2))
Dynamic array formulas.

Maybe something like this?
Book1
ABCDEFGH
1NamesSearch
2AppleApple$A$2$A$9$A$10$A$11
3Bonnie
4Carol
5Dave
6Egg
7Friend
8Ghee
9Apple
10Apple
11Apple
12Bonnie
13Bonnie
14Egg
15Egg
16Egg
17
Sheet1
Cell Formulas
RangeFormula
E2:H2E2=TOROW(FILTER(BYROW(A2:A16,LAMBDA(r,CELL("address",r))),A2:A16=D2))
Dynamic array formulas.
Hello that works great, I just winder if the formulae could be adapted for a partial match.

I did try amending D2 to be "*"&D2&"*" but this didn't work for me. Could you advise please?
 
Upvote 0

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
Perhaps:

Book1
ABCDEFGH
1NamesSearch
2AppleAppleA2A9A10A11
3Bonnie
4Carol
5Dave
6Egg
7Friend
8Ghee
9Apple
10Apple
11Apple
12Bonnie
13Bonnie
14Egg
15Egg
16Egg
Sheet1
Cell Formulas
RangeFormula
E2:H2E2=TOROW("A"&FILTER(ROW(A2:A16),A2:A16=D2))
Dynamic array formulas.
Hello that works great, I just wonder if the formulae could be adapted for a partial match.

I did try amending D2 to be "*"&D2&"*" but this didn't work for me. Could you advise please?
 
Upvote 0
Try
Book1
ABCDEFGHIJK
1NamesSearch
2AppleAppleA2A3A4A8A9A10A15
3AppleBee
4AppleSauce
5Dave
6Egg
7Friend
8Macbook Apple
9Apple
10AppleJuice
11Bonnie
12Bonnie
13Egg
14Egg
15The Greateset Apple Tree
16
Sheet10
Cell Formulas
RangeFormula
E2:K2E2=TOROW(CHAR(COLUMN(A2:A15)+64)&FILTER(ROW(A2:A15),ISNUMBER(SEARCH(D2,A2:A15))))
Dynamic array formulas.
 
Upvote 0
Solution
It's still only Column A.

Book1
ABCDEFGH
1NamesSearch
2AppleAppleA2A9A10A11
3Bonnie
4Carol
5Dave
6Egg
7Friend
8Ghee
9Apple Pie
10Apple
11Apple
12Bonnie
13Bonnie
14Egg
15Egg
16Egg
Sheet1
Cell Formulas
RangeFormula
E2:H2E2=TOROW("A"&FILTER(ROW(A2:A16),ISNUMBER(SEARCH(D2,A2:A16))))
Dynamic array formulas.
 
Upvote 0
Try
Book1
ABCDEFGHIJK
1NamesSearch
2AppleAppleA2A3A4A8A9A10A15
3AppleBee
4AppleSauce
5Dave
6Egg
7Friend
8Macbook Apple
9Apple
10AppleJuice
11Bonnie
12Bonnie
13Egg
14Egg
15The Greateset Apple Tree
16
Sheet10
Cell Formulas
RangeFormula
E2:K2E2=TOROW(CHAR(COLUMN(A2:A15)+64)&FILTER(ROW(A2:A15),ISNUMBER(SEARCH(D2,A2:A15))))
Dynamic array formulas.
This is absolutely fantastic - thank you so much:);)
 
Upvote 0
It's still only Column A.

Book1
ABCDEFGH
1NamesSearch
2AppleAppleA2A9A10A11
3Bonnie
4Carol
5Dave
6Egg
7Friend
8Ghee
9Apple Pie
10Apple
11Apple
12Bonnie
13Bonnie
14Egg
15Egg
16Egg
Sheet1
Cell Formulas
RangeFormula
E2:H2E2=TOROW("A"&FILTER(ROW(A2:A16),ISNUMBER(SEARCH(D2,A2:A16))))
Dynamic array formulas.
This is absolutely fantastic - thank you so much:);)
 
Upvote 0
This is absolutely fantastic - thank you so much:);)
Going to be very cheeky and ask - is there a formula or VBA that might be able to search through a folder containing any number of workbooks in a similar form to the one in this example. So searching for a particular text (partial match) in column A and so returning the name of the workbook where the text is found (and the tab it is on if possible if there are multiple tabs containing the text) - but to do this without me actually manually opening each workbook.;)
 
Upvote 0
It's doable with VBA but that's beyond the scope of this thread. Please start a new thread.

PS: You don't have to repeat your replies. We can see both.
 
Upvote 0
It's doable with VBA but that's beyond the scope of this thread. Please start a new thread.

PS: You don't have to repeat your replies. We can see both.
Will do thank you both so much for your help...really saved me a lot of time in work
 
Upvote 0
This is absolutely fantastic - thank you so much:);)
The marked solution has been changed accordingly. In your future questions, please mark the post as the solution that actually answered your question, instead of your feedback message as it will help future readers. No further action is required for this thread.
 
Upvote 0

Forum statistics

Threads
1,215,214
Messages
6,123,661
Members
449,114
Latest member
aides

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