Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 57
Default MATCH and INDEX combination using multiple criteria?

I'm combining the INDEX function with the MATCH function to do a lookup, but
I have multiple criteria. (I can't use the DGET function because it requires
a two row criteria range, which won't work for my situation). Can multiple
criteria work with the MATCH and INDEX combo? Or is there a different way to
do what I want to do?:

A B C
1 Name Date Amount
2 Joe 1 20.00
3 Joe 3 30.00
4 Joe 7 15.00
5 Ian 1 12.00
6 Ian 3 5.00

If my criteria is Joe, 7, I'd like Excel (2007) to return 15.00. My one
criteria INDEX and MATCH formula looks like this:

=INDEX(A1:C6,MATCH("Joe",A:A,0),3)

But it returns 20.00, the first instance of Joe.
Thanks.








  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,069
Default MATCH and INDEX combination using multiple criteria?

You can do it easily with SUMPRODUCT or with a SUM(IF( array formula. An
array formula must be entered by pressing CTRL+Shift+Enter and not just
Enter. If you do it correctly then Excel will put curly brackets around the
formula {}. You can't type these yourself. If you edit the formula you must
enter it again with CTRL+Shift+Enter.

The SUMPRODUCT formula:
=SUMPRODUCT(--(A1:A6="Joe"),--(B1:B6=7),C1:C6)

The SUM(IF( array formula:
{=SUM(IF((A1:A6="Joe")*(B1:B6=7),C1:C6,0))}

Bob Phillips explains =sumproduct() in more detail he
http://www.xldynamic.com/source/xld.SUMPRODUCT.html

Hope this helps,

Hutch

"John" wrote:

I'm combining the INDEX function with the MATCH function to do a lookup, but
I have multiple criteria. (I can't use the DGET function because it requires
a two row criteria range, which won't work for my situation). Can multiple
criteria work with the MATCH and INDEX combo? Or is there a different way to
do what I want to do?:

A B C
1 Name Date Amount
2 Joe 1 20.00
3 Joe 3 30.00
4 Joe 7 15.00
5 Ian 1 12.00
6 Ian 3 5.00

If my criteria is Joe, 7, I'd like Excel (2007) to return 15.00. My one
criteria INDEX and MATCH formula looks like this:

=INDEX(A1:C6,MATCH("Joe",A:A,0),3)

But it returns 20.00, the first instance of Joe.
Thanks.









  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,836
Default MATCH and INDEX combination using multiple criteria?

I can think of a couple things:
With 'Joe' in F1 and 'Amount' in F2
F3 =INDEX(A1:C7,MATCH(F1,A1:A7,1),MATCH(F2,A1:C1,0))

Or...
=SUMPRODUCT(--(A1:A7="Joe"),--(B1:B7=7),C1:C7)

HTH,
Ryan--

--
Ryan---
If this information was helpful, please indicate this by clicking ''Yes''.


"Tom Hutchins" wrote:

You can do it easily with SUMPRODUCT or with a SUM(IF( array formula. An
array formula must be entered by pressing CTRL+Shift+Enter and not just
Enter. If you do it correctly then Excel will put curly brackets around the
formula {}. You can't type these yourself. If you edit the formula you must
enter it again with CTRL+Shift+Enter.

The SUMPRODUCT formula:
=SUMPRODUCT(--(A1:A6="Joe"),--(B1:B6=7),C1:C6)

The SUM(IF( array formula:
{=SUM(IF((A1:A6="Joe")*(B1:B6=7),C1:C6,0))}

Bob Phillips explains =sumproduct() in more detail he
http://www.xldynamic.com/source/xld.SUMPRODUCT.html

Hope this helps,

Hutch

"John" wrote:

I'm combining the INDEX function with the MATCH function to do a lookup, but
I have multiple criteria. (I can't use the DGET function because it requires
a two row criteria range, which won't work for my situation). Can multiple
criteria work with the MATCH and INDEX combo? Or is there a different way to
do what I want to do?:

A B C
1 Name Date Amount
2 Joe 1 20.00
3 Joe 3 30.00
4 Joe 7 15.00
5 Ian 1 12.00
6 Ian 3 5.00

If my criteria is Joe, 7, I'd like Excel (2007) to return 15.00. My one
criteria INDEX and MATCH formula looks like this:

=INDEX(A1:C6,MATCH("Joe",A:A,0),3)

But it returns 20.00, the first instance of Joe.
Thanks.









  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 806
Default MATCH and INDEX combination using multiple criteria?

Hello,

For one special lookup you got the SUMPRODUCT hint already.

If you want it auto-updating for all your combinations have a look at
my UDF Sfreq, please:
http://www.sulprobil.com/html/sfreq.html

Regards,
Bernd
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
Match / Index multiple criteria return multiple results Marty Excel Worksheet Functions 2 May 22nd 10 01:49 PM
Index lookup with multiple match criteria Vance K[_2_] Excel Worksheet Functions 5 July 18th 09 07:08 AM
challenge! - match/index/lookup with multiple criteria laststraw Excel Worksheet Functions 2 May 5th 07 05:23 AM
Index & Match functions - multiple criteria and multiple results [email protected] Excel Worksheet Functions 4 May 2nd 07 03:13 AM
Index/Match Multiple Criteria EstherJ Excel Discussion (Misc queries) 2 March 31st 06 12:54 PM


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