Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 25
Default Lookup by multiple criteria?

I have a table like the following and I need to look up the 3rd column
based on the first 2. Anybody has a simple solution? Thanks a lot!

A a 3
b 5
c 1
B b 2
c 4

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Max Max is offline
external usenet poster
 
Posts: 9,221
Default Lookup by multiple criteria?

Assuming your source data is structured as below in cols A to C, from row1 down

A a 3
A b 5
A c 1
B b 2
B c 4
B d 9
etc

Just do a manual one-time fill from above for col A, to fully populate it.
If you have a lot of these to do, see Debra's page at:
http://www.contextures.com/xlDataEntry02.html
for some techniques

Then assuming inputs made in E1: A, in F1: c
Place in G1, array-enter (press CTRL+SHIFT+ENTER):
=INDEX($C$1:$C$100,MATCH(1,($A$1:$A$100=E1)*($B$1: $B$100=F1),0))
would return the required multiple criteria lookup result from col C, viz: 1

Copy G1 down to return correspondingly for other input pairs in E2:F2,
E3:F3, etc
Adjust the ranges to suit
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"muster" wrote:
I have a table like the following and I need to look up the 3rd column
based on the first 2. Anybody has a simple solution? Thanks a lot!

A a 3
b 5
c 1
B b 2
c 4


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default Lookup by multiple criteria?

Assume this table is in the range A2:C6

A.....a.....3
.........b....5
.........c....1
B.....b....2
........c.....4

F2 = lookup value = A
G2 = lookup value = c

=INDEX(C2:C6,MATCH(F2,A2:A6,0)-1+MATCH(G2,B6:OFFSET(A2,MATCH(F2,A2:A6,0)-1,1)))

Result = 1

Biff

"muster" wrote in message
ps.com...
I have a table like the following and I need to look up the 3rd column
based on the first 2. Anybody has a simple solution? Thanks a lot!

A a 3
b 5
c 1
B b 2
c 4



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 340
Default Lookup by multiple criteria?

Another alternative with data as above:

=LOOKUP(2,1/(B2:B6=G2)/(LOOKUP(ROW(2:6),ROW(2:6)/(A2:A6<""),A2:A6)
=F2),C2:C6)


[Note: The LOOKUP(ROW(2:6),ROW(2:6)/(A2:A6<""),A2:A6) part fills in
the blanks in the first column and the other part finds the last match
in the range]

On 12 Mar, 21:59, "muster" wrote:
I have a table like the following and I need to look up the 3rd column
based on the first 2. Anybody has a simple solution? Thanks a lot!

A a 3
b 5
c 1
B b 2
c 4



  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default Lookup by multiple criteria?

Slight tweak needed in the 2nd MATCH: (need to set the match_type to 0):

=INDEX(C2:C6,MATCH(F2,A2:A6,0)-1+MATCH(G2,B6:OFFSET(A2,MATCH(F2,A2:A6,0)-1,1),0))

Biff

"T. Valko" wrote in message
...
Assume this table is in the range A2:C6

A.....a.....3
........b....5
........c....1
B.....b....2
.......c.....4

F2 = lookup value = A
G2 = lookup value = c

=INDEX(C2:C6,MATCH(F2,A2:A6,0)-1+MATCH(G2,B6:OFFSET(A2,MATCH(F2,A2:A6,0)-1,1)))

Result = 1

Biff

"muster" wrote in message
ps.com...
I have a table like the following and I need to look up the 3rd column
based on the first 2. Anybody has a simple solution? Thanks a lot!

A a 3
b 5
c 1
B b 2
c 4





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 using multiple sheets and multiple criteria, sorry if 2 pos kjguillermo Excel Worksheet Functions 4 January 16th 07 03:21 AM
Lookup using multiple sheets and multiple criteria kjguillermo Excel Discussion (Misc queries) 2 January 14th 07 10:28 AM
Multiple Criteria Lookup GB Excel Worksheet Functions 3 October 3rd 06 11:55 PM
Lookup with multiple criteria... please help! Anna Excel Worksheet Functions 3 July 19th 06 09:59 PM
Multiple criteria LOOKUP Leon Excel Worksheet Functions 2 December 22nd 05 01:13 PM


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

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"