return multiple results, but then display the cell reference of each result

Jali1992

New Member
Joined
Apr 24, 2018
Messages
9
Hi Everyone, Would you be able to help me create a formula that will allow me to return multiple results, but then display the cell reference of each result

I tried to use INDEX MATCH but it will only display the first match that it finds then return the cell reference of the match, this is the formula that I have got at the moment.

=CELL("address",INDEX($H5:$XFD5,MATCH("*"&$I$1&"*",$H5:$XFD5,0)))

The Issue is that I have multiple cells that match the criteria that I am searching and I need to highlight all the cells within that row that match this.

I have tried to use INDEX SMALL COLUMN functions combined but have had no luck.

=IF(COLUMNS($A4:A4)>$F4,"",INDEX($G4:$DC4,SMALL(IF($G4:$DC4=$I$1,COLUMN($G4:$DC4)-COLUMN($G4)+1),COLUMNS($A4:A4))))

But I have had no luck achieving this

Below is a small example of the data that I am working with

First of all, I am doing a count formula to count the number of time the search criteria appears in the data so that I know how many columns I need.

In the below example there are 2 matches, hence only 2 columns, in the real example there might be 10+

Then in Cell "A3" I need the formula to pull out the first match and returns the cell reference and "B3" to show the second match etc.


ABCDEFGH
1Search Criteria1617940987
2Cell Ref1Cell Ref 2Count If FormulaNumber 1Number 2Number 3Number 4Number 5
3=COUNTIF($D5:$H2,"*"&$E$1&"*")79081617940987102987641235333016179409871231245632
4
5

<tbody>
</tbody>












Please let me know if this is possible.

If you need any further details I am happy to explain further,

Thank You In advance.
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
one thing to note is that the numbers aren't always in the same format, for example Cell E4 might contain data like this "GYHU@1617940987" but the formula still needs to pick this up
 
Upvote 0
Hi Aladin Akyurek,

Below is a small sample along with the desired results, so in the below example I am looking for anything with the cell that contains the word "Test1" regardless of any prefix or suffix that has been added.

If possible I would still require the count in the first column as this will let me know how many columns I need to insert, and the formula just needs to return the cell reference where the search criteria match.

Count A_NUMBERAMA_B_NUMBERB_NUMBERC_NUMBERB_NUMC_NUM
4G3I3J3K3 Test1Test2Test1123Test1Test132431Test214
3G4K4L4123Test1123Tst1Test2Test991123Test1Test1
5G5H5I5K5L5Test1Test1123Test131Test214123Test1123Test1

<colgroup><col><col><col><col><col><col><col><col><col><col><col span="2"></colgroup><tbody>
</tbody>


Hope this is enough detail for you.****** id="cke_pastebin" style="position: absolute; top: 176px; width: 1px; height: 1px; overflow: hidden; left: -1000px;">
K4

<tbody>
</tbody>
</body>
 
Upvote 0
Thanks for the Excel readable data and desired results...

Row\Col
A​
B​
C​
D​
E​
F​
G​
H​
I​
J​
K​
L​
2​
CountTest1A_NUMBERAMA_B_NUMBERB_NUMBERC_NUMBERB_NUMC_NUM
3​
4​
$G$3$I$3$J$3$K$3Test1Test2Test1123Test1Test132431Test214
4​
3​
$G$4$K$4$L$4123Test1123Tst1Test2Test991123Test1Test1
5​
5​
$G$5$H$5$I$5$K$5$L$5Test1Test1123Test131Test214123Test1123Test1

In A3 enter and copy down:

=COUNTIFS(G3:L3,"*"&B$2&"*")

In B3 control+shift+enter, not just enter, copy across to L3, and down:

=IFERROR(CELL("address",INDEX($G3:$L3,SMALL(IF(ISNUMBER(SEARCH($B$2,$G3:$L3)),COLUMN($G3:$L3)-COLUMN($G3)+1),COLUMNS($B3:B3)))),"")

If you want the cell addresses in a relative form, implement...

=IFERROR(SUBSTITUTE(CELL("address",INDEX($G3:$L3,SMALL(IF(ISNUMBER(SEARCH($B$2,$G3:$L3)),COLUMN($G3:$L3)-COLUMN($G3)+1),COLUMNS($B3:B3)))),"$",""),"")
 
Upvote 0
Thank you soo much, this formula works exactly as I need it to work, I think the issue with my formula was that the small was looking for a number value hence why I was getting errors, where are formula you made uses the ISNUMBER(SEARCH() to enable the checks to be carried out.
Thanks for your help Aladin. Really appreciate it!!
 
Upvote 0

Forum statistics

Threads
1,215,353
Messages
6,124,458
Members
449,161
Latest member
NHOJ

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