Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 43
Default lookup a value within a text string

I have a column with text which I want to use as basis for choosing account
based on rules in a separate columnst.

Text in A1:
01.02 7-ELEVEN Heathrow

Rule in r1:
7-ELEVEN
Account in s1:
400

I want a formula in B1 which looks up the account number from colum s when
any part of the text string in A1 matches text in column r.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,118
Default lookup a value within a text string

Try this:
B1: =IF(COUNTIF(A1,"*"&R1&"*"),S1,"no match")

Is that something you can work with?
Post back if you have more questions.
--------------------------

Regards,

Ron
Microsoft MVP (Excel)
(XL2003, Win XP)

"Henrik" wrote in message
...
I have a column with text which I want to use as basis for choosing account
based on rules in a separate columnst.

Text in A1:
01.02 7-ELEVEN Heathrow

Rule in r1:
7-ELEVEN
Account in s1:
400

I want a formula in B1 which looks up the account number from colum s when
any part of the text string in A1 matches text in column r.



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,651
Default lookup a value within a text string

On Wed, 12 Mar 2008 04:14:02 -0700, Henrik
wrote:

I have a column with text which I want to use as basis for choosing account
based on rules in a separate columnst.

Text in A1:
01.02 7-ELEVEN Heathrow

Rule in r1:
7-ELEVEN
Account in s1:
400

I want a formula in B1 which looks up the account number from colum s when
any part of the text string in A1 matches text in column r.



Provided there are no blanks in column R, this **array** formula should do
that:

=INDEX(S1:S100,MATCH(FALSE,ISERR(SEARCH(R1:R100,A1 )),0))

To enter an **array** formula, hold down <ctrl<shift while hitting <enter.
Excel will place braces {...} around the formula.
--ron
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 43
Default lookup a value within a text string

Thankyou!
I do not know how to expand to look further in the rows below r1 and s1. I
have about 100 rows and therefore nested if statements would not suffice.

BR

Henrik

Ron Coderre skrev:

Try this:
B1: =IF(COUNTIF(A1,"*"&R1&"*"),S1,"no match")

Is that something you can work with?
Post back if you have more questions.
--------------------------

Regards,

Ron
Microsoft MVP (Excel)
(XL2003, Win XP)

"Henrik" wrote in message
...
I have a column with text which I want to use as basis for choosing account
based on rules in a separate columnst.

Text in A1:
01.02 7-ELEVEN Heathrow

Rule in r1:
7-ELEVEN
Account in s1:
400

I want a formula in B1 which looks up the account number from colum s when
any part of the text string in A1 matches text in column r.




  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 43
Default lookup a value within a text string

Spot on!

Exactly the funcion i was looking for!

Thank you.

BR Henrik

Ron Rosenfeld skrev:

On Wed, 12 Mar 2008 04:14:02 -0700, Henrik
wrote:

I have a column with text which I want to use as basis for choosing account
based on rules in a separate columnst.

Text in A1:
01.02 7-ELEVEN Heathrow

Rule in r1:
7-ELEVEN
Account in s1:
400

I want a formula in B1 which looks up the account number from colum s when
any part of the text string in A1 matches text in column r.



Provided there are no blanks in column R, this **array** formula should do
that:

=INDEX(S1:S100,MATCH(FALSE,ISERR(SEARCH(R1:R100,A1 )),0))

To enter an **array** formula, hold down <ctrl<shift while hitting <enter.
Excel will place braces {...} around the formula.
--ron



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,651
Default lookup a value within a text string

On Wed, 12 Mar 2008 05:21:01 -0700, Henrik
wrote:

Spot on!

Exactly the funcion i was looking for!

Thank you.


Glad to help. Thanks for the feedback.
--ron
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
Change 3 letter text string to a number string Pete Excel Discussion (Misc queries) 3 December 31st 07 07:47 PM
lookup or find matching number in text string mmanis Excel Worksheet Functions 3 October 3rd 07 03:59 PM
Search, find or lookup defined text in text string zzxxcc Excel Worksheet Functions 9 September 6th 07 09:37 PM
LOOKUP a text string created from IF statement Steve-in-austin Excel Discussion (Misc queries) 0 May 11th 06 09:10 PM
Splitting a text string into string and number mcambrose Excel Discussion (Misc queries) 4 February 21st 06 03:47 PM


All times are GMT +1. The time now is 06:07 PM.

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

About Us

"It's about Microsoft Excel"