#1   Report Post  
Jettero2112
 
Posts: n/a
Default if and lookup


I wrote a formula to be able to change a part number based on the color
and length of a part. The color cell (always located at K14) and the
part length (E16 below but changes) in the formula change when I copy
to a new cell. How can I get it to change only the part length cell
but not the color cell when I copy to a new cell? (hope that's not too
confusing)

=IF((K14="TUDOR BROWN"),VLOOKUP(E16,TBROWN,2),IF((K14="SPANISH
CLAY"),VLOOKUP(E16,SCLAY,2),IF((K14="OCEAN
BLUE"),VLOOKUP(E16,OBLUE,2),IF((K14="SLATE
GRAY"),VLOOKUP(E16,SGRAY,2),IF((K14="REGAL
RED"),VLOOKUP(E16,RRED,2),IF((K14="CLASSIC
GREEN"),VLOOKUP(E16,CGREEN,2)))))))

Thanks.



--
Jettero2112
------------------------------------------------------------------------
Jettero2112's Profile: http://www.excelforum.com/member.php...o&userid=16622
View this thread: http://www.excelforum.com/showthread...hreadid=314875

  #2   Report Post  
N Harkawat
 
Posts: n/a
Default

Use $K$14 instead of K14

"Jettero2112" wrote in message
...

I wrote a formula to be able to change a part number based on the color
and length of a part. The color cell (always located at K14) and the
part length (E16 below but changes) in the formula change when I copy
to a new cell. How can I get it to change only the part length cell
but not the color cell when I copy to a new cell? (hope that's not too
confusing)

=IF((K14="TUDOR BROWN"),VLOOKUP(E16,TBROWN,2),IF((K14="SPANISH
CLAY"),VLOOKUP(E16,SCLAY,2),IF((K14="OCEAN
BLUE"),VLOOKUP(E16,OBLUE,2),IF((K14="SLATE
GRAY"),VLOOKUP(E16,SGRAY,2),IF((K14="REGAL
RED"),VLOOKUP(E16,RRED,2),IF((K14="CLASSIC
GREEN"),VLOOKUP(E16,CGREEN,2)))))))

Thanks.



--
Jettero2112
------------------------------------------------------------------------
Jettero2112's Profile:

http://www.excelforum.com/member.php...o&userid=16622
View this thread: http://www.excelforum.com/showthread...hreadid=314875



  #4   Report Post  
Domenic
 
Posts: n/a
Default


Try the following...

=vlookup(E16,choose(match($K$14,{"TUDOR BROWN","SPANISH CLAY","OCEAN
BLUE","SLATE GRAY","REGAL RED","CLASSIC
GREEN"},0),TBROWN,SCLAY,OBLUE,SGRAY,RRED,CGREEN),2 ,0)

OR

=vlookup(E16,choose(match($K$14,Sheet2!A1:A6,0),TB ROWN,SCLAY,OBLUE,SGRAY,RRED,CGREEN),2,0)

...where Sheet2!A1:A6 contains the following list...

TUDOR BROWN
SPANISH CLAY
OCEAN BLUE
SLATE GRAY
REGAL RED
CLASSIC GREEN

Hope this helps!

Jettero2112 Wrote:
I wrote a formula to be able to change a part number based on the color
and length of a part. The color cell (always located at K14) and the
part length (E16 below but changes) in the formula change when I copy
to a new cell. How can I get it to change only the part length cell
but not the color cell when I copy to a new cell? (hope that's not too
confusing)

=IF((K14="TUDOR BROWN"),VLOOKUP(E16,TBROWN,2),IF((K14="SPANISH
CLAY"),VLOOKUP(E16,SCLAY,2),IF((K14="OCEAN
BLUE"),VLOOKUP(E16,OBLUE,2),IF((K14="SLATE
GRAY"),VLOOKUP(E16,SGRAY,2),IF((K14="REGAL
RED"),VLOOKUP(E16,RRED,2),IF((K14="CLASSIC
GREEN"),VLOOKUP(E16,CGREEN,2)))))))

Thanks.



--
Domenic
------------------------------------------------------------------------
Domenic's Profile: http://www.excelforum.com/member.php...o&userid=10785
View this thread: http://www.excelforum.com/showthread...hreadid=314875

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
How do I lookup and return different values when the lookup value. kg Excel Discussion (Misc queries) 1 January 20th 05 12:53 AM
need check two worksheets to lookup a value Clay Excel Discussion (Misc queries) 2 January 5th 05 08:35 AM
Excel Lookup Functions Paul Adams Excel Worksheet Functions 1 November 10th 04 02:40 PM
Another Lookup function, please Butch Excel Worksheet Functions 3 November 3rd 04 08:52 AM
double lookup, nest, or macro? Josef.angel Excel Worksheet Functions 1 October 29th 04 09:50 AM


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

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"