# Extracting Specific Numbers in a String of Text

C

#### cardan

Hello,

I have what I think may be a simple question. I am working with some
code but it is a workaround. If someone can help me put the code into
excel and have it work properly I am all ears! Anyways,
I am copying and pasting strings of text (actually lines of xbrl code)
into an Excel worksheet. Each copy/paste is about 1000 rows long. Each
string comes in under one cell and is different in length but the
format is the same. Example lines are below. I need to extract out
the tag (RIAD4461 for example) and the number at towards the end that
is between brackets >###<. With my limited knowledge I can get the
RIAD4461 number with a left(cell,9) and then a right(cell,8) However I
am not sure how to get the number given their different number of
characters. Any help would be greatly appreciated.

Example Lines of Code

Assuming all your text always has the "shape" you showed us, this formula
will return the number between the ">###<"...

=LOOKUP(9E+307,--LEFT(MID(A1,FIND(">",A1)+1,99),ROW(\$1:\$99)))

--
Rick (MVP - Excel)

Hello,

I have what I think may be a simple question. I am working with some
code but it is a workaround. If someone can help me put the code into
excel and have it work properly I am all ears! Anyways,
I am copying and pasting strings of text (actually lines of xbrl code)
into an Excel worksheet. Each copy/paste is about 1000 rows long. Each
string comes in under one cell and is different in length but the
format is the same. Example lines are below. I need to extract out
the tag (RIAD4461 for example) and the number at towards the end that
is between brackets >###<. With my limited knowledge I can get the
RIAD4461 number with a left(cell,9) and then a right(cell,8) However I
am not sure how to get the number given their different number of
characters. Any help would be greatly appreciated.

Example Lines of Code

Assuming all your text always has the "shape" you showed us, this formula
will return the number between the ">###<"...

=LOOKUP(9E+307,--LEFT(MID(A1,FIND(">",A1)+1,99),ROW(\$1:\$99)))

--
Rick (MVP - Excel)

Hello,

I have what I think may be a simple question. I am working with some
code but it is a workaround. If someone can help me put the code into
excel and have it work properly I am all ears!  Anyways,
I am copying and pasting strings of text (actually lines of xbrl code)
into an Excel worksheet. Each copy/paste is about 1000 rows long. Each
string comes in under one cell and is different in length but the
format is the same. Example lines are below.  I need to extract out
the tag (RIAD4461 for example) and the number at towards the end that
is between brackets >###<. With my limited knowledge I can get the
RIAD4461 number with a left(cell,9) and then a right(cell,8) However I
am not sure how to get the number given their different number of
characters. Any help would be greatly appreciated.

Example Lines of Code