#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 26
Default Lookup query

Hi,

I need to lookup some data, find the largest amount, and then return a value
in a different cell.

Eg:

A1 B1 C1 D1
2007 2006 2005 2004

A5 B5 C5 D5
20 35 19 4


So I have to look up the largest value in A5:D5 and return the corresponding
value in the same column in cells A1 to D1.

In this case the result would be 2006.

Any ideas?
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default Lookup query

Try this:

=INDEX(A1:D1,MATCH(MAX(A5:D5),A5:D5,0))

--
Biff
Microsoft Excel MVP


"StephenAccountant" wrote in
message ...
Hi,

I need to lookup some data, find the largest amount, and then return a
value
in a different cell.

Eg:

A1 B1 C1 D1
2007 2006 2005 2004

A5 B5 C5 D5
20 35 19 4


So I have to look up the largest value in A5:D5 and return the
corresponding
value in the same column in cells A1 to D1.

In this case the result would be 2006.

Any ideas?



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,718
Default Lookup query

=SUMPRODUCT(--(A5:D5=MAX(A5:D5)),A1:D1)


"StephenAccountant" wrote:

Hi,

I need to lookup some data, find the largest amount, and then return a value
in a different cell.

Eg:

A1 B1 C1 D1
2007 2006 2005 2004

A5 B5 C5 D5
20 35 19 4


So I have to look up the largest value in A5:D5 and return the corresponding
value in the same column in cells A1 to D1.

In this case the result would be 2006.

Any ideas?

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default Lookup query

=SUMIF(A5:D5,MAX(A5:D5),A1:D1)

However, if there are duplicate max values then this and SUMPRODUCT will
return the incorrect result.

--
Biff
Microsoft Excel MVP


"Teethless mama" wrote in message
...
=SUMPRODUCT(--(A5:D5=MAX(A5:D5)),A1:D1)


"StephenAccountant" wrote:

Hi,

I need to lookup some data, find the largest amount, and then return a
value
in a different cell.

Eg:

A1 B1 C1 D1
2007 2006 2005 2004

A5 B5 C5 D5
20 35 19 4


So I have to look up the largest value in A5:D5 and return the
corresponding
value in the same column in cells A1 to D1.

In this case the result would be 2006.

Any ideas?



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 query Jax Excel Discussion (Misc queries) 4 October 29th 07 09:59 PM
Possible lookup query - XL2003 Steve Jones Excel Discussion (Misc queries) 0 July 24th 06 10:24 AM
Lookup query in excel LM Excel Worksheet Functions 2 May 29th 06 04:31 PM
Help please! Lookup/Index query. JaB Excel Discussion (Misc queries) 1 November 11th 05 11:49 AM
Matrix Query Part II - lookup value Krista F Excel Worksheet Functions 1 April 6th 05 02:18 PM


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