# extracting text between 2 text strings

#### SQUIDD

##### Well-known Member
Hi All

What is the best formula to get the number in red below, no matter what lenght the number may be.
Im confident the id= and the ">V will always be either side in green.

<tbody>
</tbody>
< a title="View Race" href="resultsRace.aspx?id=1942402">View Race
many thanks

Dave

Last edited:

### Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.

#### FDibbins

##### Well-known Member
Try this...
=LOOKUP(99^99,--("0"&MID(A1,MIN(SEARCH({0,1,2,3,4,5,6,7,8,9},A1&"0123456789")),ROW(\$1:\$10000)))) Courtesy of:*Ron Coderre

#### Joe4

Code:
``id=1942402">View Race``
If the value were in cell A1, this should get what you want:
Code:
``=MID(A1,FIND("id=",A1)+3,FIND(">V",A1)-FIND("id=",A1)-4)``

#### AliGW

##### Banned
Try this:

=LEFT(SUBSTITUTE(A1,"id=",""),FIND(">",SUBSTITUTE(A1,"id=",""))-2)

EDIT: this will not work with the amended request -sorry.

Last edited:

#### SQUIDD

##### Well-known Member
dear all

sorry, it would not let me add the full string, but i think i have it now.

dave

#### Joe4

Both the formulas Ford and I posted seem to return what you are looking for.

#### SQUIDD

##### Well-known Member
Thanks all

sorry for the confusion.
Joe, i used yours in the end.

thanks again all.

Dave

#### AlKey

##### Active Member
Here is another way

=TRIM(MID(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A1,""">","|"),"id=","|"),"|",REPT(" ",99)),99,99))

Excel 2016 (Windows) 32 bit
AB
1< a title="View Race" href="resultsRace.aspx?id=1942402">View Race1942402
Sheet4

Replies
18
Views
619
Replies
0
Views
585
Replies
1
Views
954
Replies
1
Views
891
Replies
4
Views
609

1,195,827
Messages
6,011,824
Members
441,648
Latest member
Bigjohnj

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