Find a substring within a range and return the full string.

CKsteveFFF

New Member
Joined
Nov 13, 2023
Messages
3
Office Version
  1. 365
Platform
  1. Windows
Given three variables (starting row, ending row, and substring) return the full string of the first cell found in the given range that contains the substring.

What formula can I use in D7 to return the string found within the given rows?
Looking to be able to change the rows as needed. For example, if the RowStart were changed to 1, it would return BAT1 since the range now includes another BAT further up.

I have toyed with various MATCH, SEARCH, VLOOKUP etc, but the variable range is throwing me.

1699924355508.png
 
If help is still needed here, could you also please clarify if it is possible that the range being looked at may not start in row 1. For example,
  1. Could the data be like below where the range in question is A4:A18?
  2. If so, would the expected result be ...
    • BAT1 because you are looking in rows 6 to 10 of the worksheet (yellow rows), or
    • BAT2 because you would are looking in rows 6 to 10 of the range in question (green rows)
23 11 14.xlsm
ABCD
1
2Givens
3RowStart6
4CAT4RowEnd10
5DOG1SubStringBAT
6BAT1
7COW6Result?
8OWL8
9BAT2
10DOG5
11BAT9
12COW8
13OWL4
14CAT1
15DOG6
16BAT1
17COW4
18OWL2
Find Substring
 
Upvote 0

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.

Forum statistics

Threads
1,223,236
Messages
6,170,906
Members
452,366
Latest member
TePunaBloke

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