Lookup help, please
With the exact data you provided, you could use the following nested if
statement.
=IF(OR(A1=102,A1=105,A1=116,A1=120,A1=131,A1=180), 20,IF(OR(A1=106,A1=130,A1=140,A1=150),15,IF(OR(A1= 109,A1=160),60,IF(A1=103,12,IF(A1=113,25,IF(A1=170 ,30,IF(A1=115,35,"")))))))
Since the multiple labor units are the same, you are able to use the OR
function and not exceed the limit of 7.
Of course you could still use vlookup as mentioned before. You would still
have to create the table somewhere in your workbook.
Hope this helps.
Paul
"lmatt" wrote in message
...
This is for matching job code numbers to labor units. Here are the job
code
numbers/associated labor units:
102/20, 103/12, 105/20, 106/15, 109/60, 113/25, 11435, 115/20, 116/20,
120/15, 130/20, 131/15, 140/15, 150/60, 160/30, 170/15, 180/20
Thnks.
L
"Sloth" wrote:
give me all the values you need and I will show you how to adapt our
functions to work for you.
"lmatt" wrote:
Thanks, all. My fault for not asking the question properly: what I
meant to
say was: if I have a value in cell A1 that can change, how can I write
a
function that will return a given value to the specified cell, e.g., if
cell
A1=105, then cell G1=10; if cell A1=106, then cell G1=20, etc. Further,
values along column A can repeat, and the result must always be the
same in
column G for that row. Maybe if...then isn't far off after all?
Again, thanks for any clarification you can give...
L
"Sloth" wrote:
you have a couple options. One is to use the VLOOKUP function as
PCLIVE
suggested. If you don't want to insert a table you can insert the
table as
part of the function like this
=VLOOKUP(A1,{105,20;106,15;107,10},2)
also if the options are linear (105, 106, 107, 108, 109, etc.) you
can use
the CHOOSE function like this
=CHOOSE(A1-104,20,15,10)
"lmatt" wrote:
I am trying to write a function such that the data returned to a
given cell
will vary depending upon the data entered into another cell. For
example:
If A1= 105, then G1=20; if A1=106, then G1=15
I have more variables for A1 than 7, so I don't think that nested
if...then
statements would work. Can I do this using VLOOKUP?
Thanks in advance.
L
|