#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3
Default LOOKUP instead of IF

I am trying to create a formula that searches for text in a column and
returns a matching number based on the text that is entered in that cell.

A portion of the formula that I created is below where my real list is 19
rows long, which is why I can't use the IF formula.

=LOOKUP(D13,{EUE,NUE,STC,LTC},{"0150","0151","0152 ","0153"})

When I enter this formula and check the function, the LOOKUP_Vector reads
"Invalid".

I have used the same formula with success in the same workbook, but the
look-up vector is numbers instead of text.

Any suggestions?
  #2   Report Post  
Posted to microsoft.public.excel.misc
bj bj is offline
external usenet poster
 
Posts: 1,397
Default LOOKUP instead of IF

put quote marks around the text
=LOOKUP(D13,{"EUE","NUE","STC","LTC"},{"0150","015 1","0152","0153"})
will work

"cstruthers" wrote:

I am trying to create a formula that searches for text in a column and
returns a matching number based on the text that is entered in that cell.

A portion of the formula that I created is below where my real list is 19
rows long, which is why I can't use the IF formula.

=LOOKUP(D13,{EUE,NUE,STC,LTC},{"0150","0151","0152 ","0153"})

When I enter this formula and check the function, the LOOKUP_Vector reads
"Invalid".

I have used the same formula with success in the same workbook, but the
look-up vector is numbers instead of text.

Any suggestions?

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default LOOKUP instead of IF

=LOOKUP(D13,{EUE,NUE,STC,LTC},{"0150","0151","0152 ","0153"})

The lookup_vector must be sorted ascending and you're missing " ":

=LOOKUP(D13,{"EUE","LTC","NUE","STC"},{"0150","015 1","0152","0153"})

If you have 19 pairs of data you'd be better off making a lookup table on
your sheet and referring to that table rather than hardcoding all that into
a formula.

Biff

"cstruthers" wrote in message
...
I am trying to create a formula that searches for text in a column and
returns a matching number based on the text that is entered in that cell.

A portion of the formula that I created is below where my real list is 19
rows long, which is why I can't use the IF formula.

=LOOKUP(D13,{EUE,NUE,STC,LTC},{"0150","0151","0152 ","0153"})

When I enter this formula and check the function, the LOOKUP_Vector reads
"Invalid".

I have used the same formula with success in the same workbook, but the
look-up vector is numbers instead of text.

Any suggestions?



  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3
Default LOOKUP instead of IF

Thanks for this. What would the code look like for referring to a table
rather than hardcoding my 19 pieces of data?

"T. Valko" wrote:

=LOOKUP(D13,{EUE,NUE,STC,LTC},{"0150","0151","0152 ","0153"})


The lookup_vector must be sorted ascending and you're missing " ":

=LOOKUP(D13,{"EUE","LTC","NUE","STC"},{"0150","015 1","0152","0153"})

If you have 19 pairs of data you'd be better off making a lookup table on
your sheet and referring to that table rather than hardcoding all that into
a formula.

Biff

"cstruthers" wrote in message
...
I am trying to create a formula that searches for text in a column and
returns a matching number based on the text that is entered in that cell.

A portion of the formula that I created is below where my real list is 19
rows long, which is why I can't use the IF formula.

=LOOKUP(D13,{EUE,NUE,STC,LTC},{"0150","0151","0152 ","0153"})

When I enter this formula and check the function, the LOOKUP_Vector reads
"Invalid".

I have used the same formula with success in the same workbook, but the
look-up vector is numbers instead of text.

Any suggestions?




  #5   Report Post  
Posted to microsoft.public.excel.misc
bj bj is offline
external usenet poster
 
Posts: 1,397
Default LOOKUP instead of IF

if your text were in C20 through C40
and the associated numbers in D20 through D40
try
=vlookup(D13,C20:D40,2)

"cstruthers" wrote:

Thanks for this. What would the code look like for referring to a table
rather than hardcoding my 19 pieces of data?

"T. Valko" wrote:

=LOOKUP(D13,{EUE,NUE,STC,LTC},{"0150","0151","0152 ","0153"})


The lookup_vector must be sorted ascending and you're missing " ":

=LOOKUP(D13,{"EUE","LTC","NUE","STC"},{"0150","015 1","0152","0153"})

If you have 19 pairs of data you'd be better off making a lookup table on
your sheet and referring to that table rather than hardcoding all that into
a formula.

Biff

"cstruthers" wrote in message
...
I am trying to create a formula that searches for text in a column and
returns a matching number based on the text that is entered in that cell.

A portion of the formula that I created is below where my real list is 19
rows long, which is why I can't use the IF formula.

=LOOKUP(D13,{EUE,NUE,STC,LTC},{"0150","0151","0152 ","0153"})

When I enter this formula and check the function, the LOOKUP_Vector reads
"Invalid".

I have used the same formula with success in the same workbook, but the
look-up vector is numbers instead of text.

Any suggestions?






  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3
Default LOOKUP instead of IF

Thanks Sooooo Much! This helped me a ton!


"bj" wrote:

if your text were in C20 through C40
and the associated numbers in D20 through D40
try
=vlookup(D13,C20:D40,2)

"cstruthers" wrote:

Thanks for this. What would the code look like for referring to a table
rather than hardcoding my 19 pieces of data?

"T. Valko" wrote:

=LOOKUP(D13,{EUE,NUE,STC,LTC},{"0150","0151","0152 ","0153"})

The lookup_vector must be sorted ascending and you're missing " ":

=LOOKUP(D13,{"EUE","LTC","NUE","STC"},{"0150","015 1","0152","0153"})

If you have 19 pairs of data you'd be better off making a lookup table on
your sheet and referring to that table rather than hardcoding all that into
a formula.

Biff

"cstruthers" wrote in message
...
I am trying to create a formula that searches for text in a column and
returns a matching number based on the text that is entered in that cell.

A portion of the formula that I created is below where my real list is 19
rows long, which is why I can't use the IF formula.

=LOOKUP(D13,{EUE,NUE,STC,LTC},{"0150","0151","0152 ","0153"})

When I enter this formula and check the function, the LOOKUP_Vector reads
"Invalid".

I have used the same formula with success in the same workbook, but the
look-up vector is numbers instead of text.

Any suggestions?



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
LOOKUP a text string created from IF statement Steve-in-austin Excel Discussion (Misc queries) 0 May 11th 06 10:10 PM
Another way to lookup data David Vollmer Excel Worksheet Functions 1 September 23rd 05 06:16 AM
Lookup Vector > Lookup Value Alec Kolundzic Excel Worksheet Functions 6 June 10th 05 03:14 PM
Lookup function w/Text and Year Josh O. Excel Worksheet Functions 1 February 13th 05 12:27 AM
double lookup, nest, or macro? Josef.angel Excel Worksheet Functions 1 October 29th 04 10:50 AM


All times are GMT +1. The time now is 01:48 PM.

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"