PC Review


Reply
Thread Tools Rate Thread

How do I lookup from a table

 
 
Rj
Guest
Posts: n/a
 
      18th Feb 2009
I am trying to do a lookup that looks like this.
SHEET1
A B C
1 7000 AAA Need Formula to = 'RED'
2 8000 BBB Need Formula to = 'RED'
3 7000 BBB Need formula to = 'BLUE'
4 6000 CCC Need formula to = 'GREEN'
5 7000 CCC Need formula to = 'WHITE'

SHEET 2
A B C D E F
1 AAA BBB CCC
2 5000 GREEN 4500 WHITE 4100 YELLOW
3 6000 WHITE 5500 YELLOW 6000 GREEN
4 7000 RED 7000 BLUE 7000 WHITE
5 8000 YELLOW 8000 RED 8500 RED

I am trying to write a formula for C1:C5 in SHEET 1 to automatically find
the colors using the ARRAY A1:F5 of SHEET 2. For instance, 7000 under AAA =
Red, but 7000 under BBB = BLUE.

 
Reply With Quote
 
 
 
 
Luke M
Guest
Posts: n/a
 
      18th Feb 2009
=VLOOKUP(A1,INDIRECT("'Sheet2'!R1C"&MATCH(B1,Sheet2!$A$1:$F$1)&":R5C"&MATCH(B1,Sheet2!$A$1:$F$1)+1,FALSE),2,FALSE)

If your array is actually larger, change the number in "R5C" to whatever row
it needs to be.
--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"Rj" wrote:

> I am trying to do a lookup that looks like this.
> SHEET1
> A B C
> 1 7000 AAA Need Formula to = 'RED'
> 2 8000 BBB Need Formula to = 'RED'
> 3 7000 BBB Need formula to = 'BLUE'
> 4 6000 CCC Need formula to = 'GREEN'
> 5 7000 CCC Need formula to = 'WHITE'
>
> SHEET 2
> A B C D E F
> 1 AAA BBB CCC
> 2 5000 GREEN 4500 WHITE 4100 YELLOW
> 3 6000 WHITE 5500 YELLOW 6000 GREEN
> 4 7000 RED 7000 BLUE 7000 WHITE
> 5 8000 YELLOW 8000 RED 8500 RED
>
> I am trying to write a formula for C1:C5 in SHEET 1 to automatically find
> the colors using the ARRAY A1:F5 of SHEET 2. For instance, 7000 under AAA =
> Red, but 7000 under BBB = BLUE.
>

 
Reply With Quote
 
T. Valko
Guest
Posts: n/a
 
      18th Feb 2009
Try this:

=VLOOKUP(A1,Sheet2!F$2:F$5:INDEX(Sheet2!A$2:F$5,,MATCH(B1,Sheet2!A$1:F$1,0)),2,0)

Copy down as needed.

--
Biff
Microsoft Excel MVP


"Rj" <(E-Mail Removed)> wrote in message
news:C0750B92-EBCF-43EA-BE88-(E-Mail Removed)...
>I am trying to do a lookup that looks like this.
> SHEET1
> A B C
> 1 7000 AAA Need Formula to = 'RED'
> 2 8000 BBB Need Formula to = 'RED'
> 3 7000 BBB Need formula to = 'BLUE'
> 4 6000 CCC Need formula to = 'GREEN'
> 5 7000 CCC Need formula to = 'WHITE'
>
> SHEET 2
> A B C D E F
> 1 AAA BBB CCC
> 2 5000 GREEN 4500 WHITE 4100 YELLOW
> 3 6000 WHITE 5500 YELLOW 6000 GREEN
> 4 7000 RED 7000 BLUE 7000 WHITE
> 5 8000 YELLOW 8000 RED 8500 RED
>
> I am trying to write a formula for C1:C5 in SHEET 1 to automatically find
> the colors using the ARRAY A1:F5 of SHEET 2. For instance, 7000 under AAA
> =
> Red, but 7000 under BBB = BLUE.
>



 
Reply With Quote
 
Ashish Mathur
Guest
Posts: n/a
 
      18th Feb 2009
Hi,

You can also try the following:

1. On sheet 2, highlight A2:B5 and press Ctrl+F3 - assign it a name, say
AAA. Please do the same for C25 and E2:F5 as well. Assign BBB and CCC;
2. Now in cell C1 of sheet 1, you can use the following VLOOKUP() formula
=vlookup(A1,indirect(B1),2,0)

Please ensure that the names in column B of sheet1 are the same as the names
defined on sheet 2.

--
Regards,

Ashish Mathur
Microsoft Excel MVP
www.ashishmathur.com

"Rj" <(E-Mail Removed)> wrote in message
news:C0750B92-EBCF-43EA-BE88-(E-Mail Removed)...
> I am trying to do a lookup that looks like this.
> SHEET1
> A B C
> 1 7000 AAA Need Formula to = 'RED'
> 2 8000 BBB Need Formula to = 'RED'
> 3 7000 BBB Need formula to = 'BLUE'
> 4 6000 CCC Need formula to = 'GREEN'
> 5 7000 CCC Need formula to = 'WHITE'
>
> SHEET 2
> A B C D E F
> 1 AAA BBB CCC
> 2 5000 GREEN 4500 WHITE 4100 YELLOW
> 3 6000 WHITE 5500 YELLOW 6000 GREEN
> 4 7000 RED 7000 BLUE 7000 WHITE
> 5 8000 YELLOW 8000 RED 8500 RED
>
> I am trying to write a formula for C1:C5 in SHEET 1 to automatically find
> the colors using the ARRAY A1:F5 of SHEET 2. For instance, 7000 under AAA
> =
> Red, but 7000 under BBB = BLUE.
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Use a lookup field, or lookup table? =?Utf-8?B?UmljdGVy?= Microsoft Access 2 19th Jan 2006 05:27 AM
Lookup field versus lookup table?? and sorting?? =?Utf-8?B?SlIgSGVzdGVy?= Microsoft Access Database Table Design 1 4th Nov 2005 08:39 PM
Get Range to Lookup from a Lookup table JG Scott Microsoft Excel Discussion 2 15th Oct 2005 02:09 PM
Need to add to the lookup table from a form lookup field (Access) =?Utf-8?B?RG9nZ2Vy?= Microsoft Access Forms 0 13th Sep 2005 05:47 PM
Pivot table doing a lookup without using the lookup function? =?Utf-8?B?TkdBU0dFTEk=?= Microsoft Excel Misc 0 2nd Aug 2005 05:08 AM


Features
 

Advertising
 

Newsgroups
 


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