# 1st, 2nd, 3rd occurence of text search from the right

#### seanh1016

##### Active Member
Here's an example of my cells:
a1=person one Name:

I'm looking for every occurence of "Name:" It is always on the rightmost side of the cell. And each occurrence is not an evenly spaced amount of rows in between.

Once I find each occurence, I'd like to stack the names in a column.

### Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
Here is what I do... might be an easier way.... but this works.

Add two columns to the left of A (you will hide these later)
Now your A data should be in C

In column B enter the following formula:
=if(right(A1,5)="Name:",1,0)
Copy the formula down column B

In column A enter the following formula:
=if(B1=0,0,sum(B1:\$B\$1))
Copy the formula down column A

Column A counts each occurance of 1 in column B
Column B finds each occurance of "Name:" and marks it with a 1

Now you can name your range A1:Whatever

Do a lookup on another sheet to reference the names.

Column A enter 1-whatever

Lookup:

=vlookup(A1,range,column index,0)

Replies
1
Views
167
Replies
10
Views
344
Replies
2
Views
193
Replies
3
Views
175
Replies
2
Views
158

### Forum statistics

1,196,460
Messages
6,015,376
Members
441,889
Latest member
balolaptopgiaolong

### 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.

### Which adblocker are you using?

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

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