#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
ASHA27
 
Posts: n/a
Default LOOKUP FUNCTION

Hello all,

I am working with the following cells

A B

HAC024GKC 2
HAC418GKC 4
HAC224GKC 16

I would like to write a funcition that looks at the first 4 integers of the
cells in Column a and performs an output based on those integers.

Example : If it starts with HAC0 then multiply 10 times the field adjacent
to the right

If it starts with HAC4 then multiply 30 time the adjacent field.

If it starts with HAC2 then multiply 20 times the adjacent field.

My thought were to use the "LEFT" function inside of a "LOOKUP" Function.
The reason I am using the lookup instead of an "IF" function is because I
will be looking at more than 7 values. I am getting all sorts of errors when
I try this.

Any ideas?




  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
daddylonglegs
 
Posts: n/a
Default LOOKUP FUNCTION


Hi ASHA27,

You can use left within a LOOKUP or VLOOKUP formula but you either need
a separate table to show HAC0, HAC4 etc and the corresponding values or
you'll have to include all those in the formula, the first option (a
table) is normally the best, e.g. if you have your "HAC0" etc in C1
down and the corresponding multiplier in D1 down

=VLOOKUP(LEFT(A2),C:D,2,0)*B2

If all your text in column A begins with "HAC" perhaps you could simply
look at the 4th character...

=VLOOKUP(MID(A2,4,1)+0,C:D,2,0)*B2


--
daddylonglegs
------------------------------------------------------------------------
daddylonglegs's Profile: http://www.excelforum.com/member.php...o&userid=30486
View this thread: http://www.excelforum.com/showthread...hreadid=516565

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
RagDyeR
 
Posts: n/a
Default LOOKUP FUNCTION

Try this in C1:

=LOOKUP(--MID(A1,4,1),{0,2,4;10,20,30})*B1

And copy down as needed.
--

HTH,

RD
================================================== ===
Please keep all correspondence within the Group, so all may benefit!
================================================== ===

"ASHA27" wrote in message
...
Hello all,

I am working with the following cells

A B

HAC024GKC 2
HAC418GKC 4
HAC224GKC 16

I would like to write a funcition that looks at the first 4 integers of the
cells in Column a and performs an output based on those integers.

Example : If it starts with HAC0 then multiply 10 times the field adjacent
to the right

If it starts with HAC4 then multiply 30 time the adjacent field.

If it starts with HAC2 then multiply 20 times the adjacent field.

My thought were to use the "LEFT" function inside of a "LOOKUP" Function.
The reason I am using the lookup instead of an "IF" function is because I
will be looking at more than 7 values. I am getting all sorts of errors
when
I try this.

Any ideas?





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 Function help marlea Excel Discussion (Misc queries) 2 August 23rd 05 07:30 PM
Lookup Function Problems FFW Excel Worksheet Functions 2 August 21st 05 04:22 PM
Complicated lookup function chrisrowe_cr Excel Worksheet Functions 4 July 19th 05 05:52 PM
lookup function 1 Colboyfx Excel Worksheet Functions 4 July 15th 05 09:15 AM
How do I use 3 cells to create the string for a lookup function? Bencomo Excel Worksheet Functions 1 May 15th 05 07:17 AM


All times are GMT +1. The time now is 08:51 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"