SEARCH-SUBSTITUTE against an array...need help!

akparasite

Board Regular
Joined
Jul 15, 2002
Messages
55
I have a problem. Some of my work cohorts entered data into a column not following the convention we had all agreed to. As a result I have a list of hyphenated numbers (i.e. "01-15") written within text strings, but I need to roll additional data pertaining to each within the text string. There are about 5,000 cells of data in this column with these hyphenated numbers.

I have a table/array to relate the hyphenated numbers with the additional information that needs to be included within each cell. For example, instead of just writing "01-15" the employees should have written the following:

"01-15, MG-5, Primary Power Gen #5, Wartsilla 5000 KW Generator"

I need a function to search and substitute the values from the array into the text, if it is indeed there, and get the data in the cell where format is not too important at the moment.

I can understand searching one value by using the following formula:

=IF(ISNUMBER(SEARCH(A17,A2)),SUBSTITUTE(A2,A17,CONCATENATE(B17," , ",C17," , ",D17)),A2)

...but, having the function look for multiple values in an array is confusing me. Is there some way I could use VLOOKUP in this? How can I do this and save myself hours/weeks of work?

As always, this site is an amazing resource, and I greatly appreciate any help you can provide.

...a sample of my data:
Book4
ABCD
1Location
2SourceLocations(generatortags):94-05,94-06,94-07SourceLocations(generatortags):MG-7,ServicesBack-upGen.,Caterpillar650KWGenerator,94-06,94-07
3source_location 14-17 14-5 14-6
4source_location 01-11 01-12 01-13 01-14 01-15 01-31 01-49 01-54
5manymore
6
7Table/Array
8RedDogType-SeqNumberSourceNumberEquipmentUseDescription
901-11MG-1PirmaryPowerGen#1Wartsila5000KWGenerator
1001-12MG-2PirmaryPowerGen#2Wartsila5000KWGenerator
1101-13MG-3PirmaryPowerGen#3Wartsila5000KWGenerator
1201-14MG-4PirmaryPowerGen#4Wartsila5000KWGenerator
1301-15MG-5PirmaryPowerGen#5Wartsila5000KWGenerator
1401-31MG-6PirmaryPowerGen#6Wartsila5000KWGenerator
1501-49MG-17PirmaryPowerGen#7Wartsila5000KWGenerator
1601-54MG-18PirmaryPowerGen#8Wartsila5000KWGenerator
1794-05MG-7ServicesBack-upGen.Caterpillar650KWGenerator
1894-06MG-8ServicesBack-upGen.Caterpillar650KWGenerator
1994-07MG-9PAC-Back-upGen.Caterpillar650KWGenerator
2094-11MG-10CONPACBack-upGen.DetroitDieselAllson275KW
21manymore.
Sheet1
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
The way the sample data appears to have been input, it is not an array but a string. The most efficient way to do this would be to use a suitable custom function designed to handle all the varieties of input which could possibly be encountered - you might try to get someone to write it for you.
 
Upvote 0

Forum statistics

Threads
1,215,465
Messages
6,124,973
Members
449,200
Latest member
Jamil ahmed

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