Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default Get word from a string

This is a record from bank statement:

WIRE TYPE:FX OUT DATE:081104 TIME:1701 ET TRN:2008103100323691 FX:GBP
92.83 1.624484 BNF:ZEN INTERNET LTD ID:29366585 BNF BK:NATWEST BANK
ID:SC010744 PMT DET:0000002005115610FROM JUPITERRESEARCH PRO-FORMA
NUMBER 6290280

I want to use Function or Code to get ZEN INTERNET LTD, that is the
words between BNF and ID. Beneficiary's name could be 2, words, 3
words, 4 words, so that there is no pattern.

How could I do this? Please advise. Thanks a lot!

H.Z..
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 913
Default Get word from a string

On Sat, 13 Dec 2008 11:07:20 -0800 (PST), Curious
wrote:

This is a record from bank statement:

WIRE TYPE:FX OUT DATE:081104 TIME:1701 ET TRN:2008103100323691 FX:GBP
92.83 1.624484 BNF:ZEN INTERNET LTD ID:29366585 BNF BK:NATWEST BANK
ID:SC010744 PMT DET:0000002005115610FROM JUPITERRESEARCH PRO-FORMA
NUMBER 6290280

I want to use Function or Code to get ZEN INTERNET LTD, that is the
words between BNF and ID. Beneficiary's name could be 2, words, 3
words, 4 words, so that there is no pattern.

How could I do this? Please advise. Thanks a lot!

H.Z..



If the record is in cell A1, you may try the following formula:

=MID(A1,FIND("BNF:",A1)+4,FIND("ID:",A1)-FIND("BNF:",A1)-5)

Hope this helps / Lars-Åke
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default Get word from a string

Try this...

BeneficiaryName = Trim(Split(Split(BankRecordText, "BNF:")(1), "ID:")(0))

where BankRecordText is the text you posted.

--
Rick (MVP - Excel)


"Curious" wrote in message
...
This is a record from bank statement:

WIRE TYPE:FX OUT DATE:081104 TIME:1701 ET TRN:2008103100323691 FX:GBP
92.83 1.624484 BNF:ZEN INTERNET LTD ID:29366585 BNF BK:NATWEST BANK
ID:SC010744 PMT DET:0000002005115610FROM JUPITERRESEARCH PRO-FORMA
NUMBER 6290280

I want to use Function or Code to get ZEN INTERNET LTD, that is the
words between BNF and ID. Beneficiary's name could be 2, words, 3
words, 4 words, so that there is no pattern.

How could I do this? Please advise. Thanks a lot!

H.Z..


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default Get word from a string

If you are actually after a worksheet formula instead of code, you might
consider this one in addition to the others posted so far...

=TRIM(MID(LEFT(A1,FIND("ID:",A1)-1),FIND("BNF:",A1)+4,999))

The formula assumes no record will be longer than 999 characters (increase
the 999 if it will).

--
Rick (MVP - Excel)


"Rick Rothstein" wrote in message
...
Try this...

BeneficiaryName = Trim(Split(Split(BankRecordText, "BNF:")(1), "ID:")(0))

where BankRecordText is the text you posted.

--
Rick (MVP - Excel)


"Curious" wrote in message
...
This is a record from bank statement:

WIRE TYPE:FX OUT DATE:081104 TIME:1701 ET TRN:2008103100323691 FX:GBP
92.83 1.624484 BNF:ZEN INTERNET LTD ID:29366585 BNF BK:NATWEST BANK
ID:SC010744 PMT DET:0000002005115610FROM JUPITERRESEARCH PRO-FORMA
NUMBER 6290280

I want to use Function or Code to get ZEN INTERNET LTD, that is the
words between BNF and ID. Beneficiary's name could be 2, words, 3
words, 4 words, so that there is no pattern.

How could I do this? Please advise. Thanks a lot!

H.Z..





Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
second word in a string Wanna Learn Excel Discussion (Misc queries) 3 August 26th 09 05:26 PM
Matching CELL text (full word) to full word in string in another DShaw Excel Programming 7 September 12th 06 05:25 PM
How do I extract a word from a string? Gabe Tiger Excel Programming 4 July 14th 06 03:52 PM
WORD-DELIMITED string vba macro for excel/word jackal2k6 Excel Programming 3 December 23rd 05 04:32 PM
identify a word in a string then change the format of that word EazyExcel Excel Programming 2 May 15th 05 07:05 PM


All times are GMT +1. The time now is 03:13 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"