Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel,microsoft.public.excel.worksheet.functions
 
Posts: n/a
Default Conditional Lookup?


Hi the

I am trying to accomplish the following. Given the following list of
data:

A B C D E
----------------------------------------------
1 | Num1 Num2 Num3 Num4
2 | -2 0 -3 -1

where row 1 contains the data header, I would like to set up a formula
in cell E2 which looks through the range A2:D2 for the most -ve number
and returns its row header from row 1. I'm not having much luck with
the LOOKUP function (unless the values in row 2 are sorted in
increasing order).

TIA,
K

  #2   Report Post  
Posted to microsoft.public.excel,microsoft.public.excel.worksheet.functions
vezerid
 
Posts: n/a
Default Conditional Lookup?

K,
is it the most negative number you are seeking? And it has to be
negative? If so, this formula will produce the correct header:
=INDEX(A1:D1,MATCH(MIN(IF(A2:D2<0, A2:D2, 1)), A2:D2, 0))
It must be array entered, i.e. Shift+Ctrl+Enter

HTH
Kostis Vezerides

  #3   Report Post  
Posted to microsoft.public.excel,microsoft.public.excel.worksheet.functions
 
Posts: n/a
Default Conditional Lookup?

Thanks! Hadn't realised that I would need an array formula.. but it
works perfectly.

K

  #5   Report Post  
Posted to microsoft.public.excel,microsoft.public.excel.worksheet.functions
Dave Peterson
 
Posts: n/a
Default Conditional Lookup?

Maybe this one:
=INDEX($A$1:$D$1,MATCH(MIN(A2:D2),A2:D2,0))

or if you really want to check for negatives:
=IF(COUNTIF(A2:D2,"<"&0)=0,"no negatives",
INDEX($A$1:$D$1,MATCH(MIN(A2:D2),A2:D2,0)))
(all one cell)

wrote:

Hi the

I am trying to accomplish the following. Given the following list of
data:

A B C D E
----------------------------------------------
1 | Num1 Num2 Num3 Num4
2 | -2 0 -3 -1

where row 1 contains the data header, I would like to set up a formula
in cell E2 which looks through the range A2:D2 for the most -ve number
and returns its row header from row 1. I'm not having much luck with
the LOOKUP function (unless the values in row 2 are sorted in
increasing order).

TIA,
K


--

Dave Peterson


  #6   Report Post  
Posted to microsoft.public.excel,microsoft.public.excel.worksheet.functions
Gaj Vidmar
 
Posts: n/a
Default Conditional Lookup?

One of the many possible solutions should be

=offset(A1,0,match(min(A2:D2),A2:D2,0)-1)

Note that if there are multiple minimuma, this will, of course, return the
label above the first one of them (looking from the left side rightwards),
but handling that (e.g. with a warning) would require VBA programming, and
is probably also beyond what you need.

Regards,
Gaj Vidmar

wrote in message
oups.com...

Hi the

I am trying to accomplish the following. Given the following list of
data:

A B C D E
----------------------------------------------
1 | Num1 Num2 Num3 Num4
2 | -2 0 -3 -1

where row 1 contains the data header, I would like to set up a formula
in cell E2 which looks through the range A2:D2 for the most -ve number
and returns its row header from row 1. I'm not having much luck with
the LOOKUP function (unless the values in row 2 are sorted in
increasing order).

TIA,
K



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
Conditional Lookup AlanM Excel Discussion (Misc queries) 3 November 18th 05 04:55 PM
Conditional Formatting - Lookup Range murphyz Excel Discussion (Misc queries) 8 August 24th 05 03:55 PM
Conditional Lookup Functions Rlmccants Excel Worksheet Functions 4 August 11th 05 10:14 PM
Conditional Lookup on Multiple Criteria TBarker Excel Worksheet Functions 1 June 22nd 05 12:28 AM
conditional lookup JimVarney01 Excel Worksheet Functions 0 May 24th 05 11:40 PM


All times are GMT +1. The time now is 03:20 PM.

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"