Find each occurance of string and return column value(s) where string was found

rknudson

New Member
Joined
Jun 18, 2021
Messages
10
Office Version
  1. 365
Platform
  1. Windows
I have an array of text in range Sheet1!$A$2:$BM$111 that I am trying to match each value that is in column Adresses!a4:a1098 and return the column in sheet1! where the string was found.

I have this formula

INDEX(Sheet1!$A$1:$BM$1, SUMPRODUCT(MAX((Sheet1!$A$2:$BM$111=A4)*(COLUMN(Sheet1!$A$2:$BM$111))))-COLUMN(Sheet1!$A$1)+1)

This formula will match the last item it finds. I am trying to get it to match each find and then return the corresponding index column to where it was found. Also if nothing is found it will return all index columns where it should be a blank. I hope I explained this well enough. I am frustratedly stuck.
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
Hi & welcome to MrExcel.

Can you post some sample data.

MrExcel has a tool called “XL2BB” that lets you post samples of your data that will allow us to copy/paste it to our Excel spreadsheets, so we can work with the same copy of data that you are. Instructions on using this tool can be found here: XL2BB Add-in

Note that there is also a "Test Here” forum on this board. This is a place where you can test using this tool (or any other posting techniques that you want to test) before trying to use those tools in your actual posts.
 
Upvote 0
CTCOEP-6-14-21.xlsx
ABCDEFGHIJKLMNOPQRSTUVWXYZAAABACADAEAFAGAHAIAJAKALAMANAOAPAQARASATAUAVAWAXAYAZBABBBCBDBEBFBGBHBIBJBKBLBM
1Public_165.1.59.0-HostsNYC-XP-HostsAkamai-Whitelistthunderstone.hostsAmazon.trap.senderssubnet.165.1.0.0ctc.https.publicaws-us-east-1-whitelistMashery-WhitelistbadguysAPImagesBadguysBadhostctc.external.devicescrmQA-DEVctc.http.8080Mobile-Newstacacs.serversmimecast-int-hostsctc.ftp.publicctc.http.publicClassification.ServersHosted2.ServersSNMP.trap.recieversSMTP-CTC-VIPsHosted1.ServersTeraMark-Badguysctc.dmz.email.publicaccess-edge-lync-srvweb-conf-lync-srva-v-lync-srvvancouver.destinationsManagement-Networksctc.Outside.firewallsctceaisqlInternal.MS.Office365Bureau-Private-NATsamazonfiberlink.radius.serversftp.fdch.com.serversmarkets-ftp-serversSMTP.outboundSMTP-out-blockMimecastmimecast-datacentersCTC-UserNetssubnet.165.1.58.0subnet.165.1.59.0subnet.172.16.0.0subnet.173.1.245.32-sm27subnet.174.129.0.0-sm16subnet.64.151.88.240-sm28subnet.74.3.238.80-sm28ctc.dmz.nntp.serversthunderstone.hosts.apsportspowersubnet.10.0.0.0subnet.192.168.0.0salesforce.subnetsstatsinc.destinationsStatic-Routesstatsinc.serverssubnet.all.apSubnet.MS.Office365subnet.gogridftp.sourcesvancouver.servers
2accuweatherbakadvstgdemo.apextAkamai.204.237.142.0ap.thunderstone.comAPMS1-3-Teragram-LB.elb.amazonaws.comap-public-rangeaccess-edge-lync-srvAWS-AWS-Gateway1-US-Westbadguy.100.43.153.60badguys109.77.17.144Badhost-10.1.26.163crctcamazon1CRMgwd-extctcapmobile01-extctcapmobile01-extctcciscoworksctcdc20-intapdigftppullnewaccuweatherbakctceapiclacl1_26.230CTCEAPXCNSWEB01_124.167CTCESMNNM01-extCTCEXCH01-extctchnewsedge01_65.201badguy_10.1.22.23ctcipdx01CTCLYNCEDGE01_52.111CTCLYNCEDGE01_52.112CTCLYNCEDGE01_52.113ctcmegamq01ctcneteng01-42.64ctcoutep01ctcxapif1am_49.84CTCXTOOLS01-extEastern-Privateec2-184-73-121-236.compute-1.amazonaws.comblue-bellftp.fdch.comftp1.tradeline.comH-10.1.60.205H-10.1.62.45mimecast-network-1mimecast-network-1N-10.1.104.0-24N-165.1.58.0-24N-165.1.59.0-24N-172.16.0.0-12N-173.1.245.32-27N-174.129.0.0-16N-64.151.88.240-28N-74.3.238.80-28newscliptestnrack.thunderstone.comobj-10.0.0.0obj-192.168.0.0Salesforce-Merachnic-home-4testingctcmegamq01Static-Route-107.21.26.30statsinc10.statsinc.comsubnet.10.0.0.0subnet.104.212.58.0-sm23subnet.173.1.245.32-sm27cp143.cp.orgvancouver1
3adsendweb05CTCAPIQCPXFA01_52.75Akamai.23.203.52.0nrack.thunderstone.comEC2APMSCLA01.amazonaws.comadsendweb05AWS-54.71.177.216AWS-Gateway-Europebadguy.104.194.160.59badguys178.149.67.27Badhost-10.1.7.70crctcsla1CRMgwq-extctcapmobile03-extctcapmobile03-extctcnetfinityctciam21_111_6apmebetaadsendweb05ctceapiclasql01_26.228CTCEAPXCNSWEB02_124.168CTCEXCH02-extctchnewsedge02_65.202badguy_165.1.16.189ctcipdx02-extCTCLYNCEDGE02_52.121CTCLYNCEDGE02_52.122CTCLYNCEDGE02_52.123ctcmegamq02ctcpanaorama01-175.25ctcoutep02ctcxapif1c0_49.85CTCXTOOLS02-extWDC-Bureau-Privateec2-204-236-192-128.compute-1.amazonaws.comfiberlinkrad05ftp.fdch2.comftp3.tradeline.comH-10.1.60.206H-10.1.62.46mimecast-network-2mimecast-network-2N-10.1.105.0-24seaspritesalesforce-subnet-member1.2ctcmegamq02Static-Route-118.41.146.213statsinc5.statsinc.comsubnet.165.1.0.0subnet.104.47.0.0-sm17subnet.64.151.88.240-sm28cp153.cp.orgvancouver2
4advstgdemo.apextCTCAPIQCPXFA02_52.76Akamai.23.215.104.0thunder.thunderstone.com1EC2APMSCLA01a.amazonaws.comadvstgdemo.apextaws-us-east-1-whitelist-member1AWS-Gateway-IP2-Europebadguy.114.143.243.234badguys74.115.1.41Badhost-10.6.50.56crispmasterctcapmobile04-extctcapmobile04-extctcnetfinity01_29.25campaignplusadvstgdemo.apextctceapiclasql02_26.229CTCEAPXCNWEB01_124.11CTCEXCH03-extctchnewsedge03_65.203bncanystream01ctcipmx01ctcunixdev01CTCPANORAMA01ctcoutep-clusterctcxapif1c1_49.86SMTP-CTC.AP-extWestern-Bureau-Privatefiberlinkrad06ftp.fdch3.comftp6.tradeline.comH-10.1.62.60mimecast-network-3mimecast-network-3N-10.1.107.0-24newsfeedsalesforce-subnet-member1.3ctcunixdev01Static-Route-12.130.28.213statsinc6.statsinc.comsubnet.172.16.0.0subnet.111.221.112.0-sm21subnet.74.3.238.80-sm28desktop-knudson-verizon
Sheet1
 
Upvote 0
Data I am searching for example

accuweatherbak
adres-beta
adsendweb05
advstgdemo.apext
 
Upvote 0
Upvote 0
Solution
Perfect, I attempted textjoin prior but was not getting the result I needed. Thank you for the quick response.
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,788
Messages
6,121,582
Members
449,039
Latest member
Arbind kumar

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