#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 7
Default MIN IF?

I have a table with two columns:

Col_1 Col_2
XXX-YYY 123
XXX-YYY 120
YYY-QQQ 143

I want to find the minimum in col_2 for each entry in Col_1.

I have done it using a pivot table but would like to be more flexible.

Is there a way of nesting the MIN and an IF statement?

Steve

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,651
Default MIN IF?

=MIN(IF(A$1:A$3=A1,B$1:B$3)) as an *array formula*, and copy down.
--
David Biddulph

wrote in message
oups.com...
I have a table with two columns:

Col_1 Col_2
XXX-YYY 123
XXX-YYY 120
YYY-QQQ 143

I want to find the minimum in col_2 for each entry in Col_1.

I have done it using a pivot table but would like to be more flexible.

Is there a way of nesting the MIN and an IF statement?

Steve



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,501
Default MIN IF?

It's not quite clear what you wnat but I assume for the data below for
XXX-YYY you would want to return 120 and for YYY-QQQ you would return 143. If
that's correct try:-

=MIN(IF(A1:A4="XXX-YYY",B1:B4))

Alter the ranges to suit. It's an array so enter with Ctrl+Shift+Enter

Mike

" wrote:

I have a table with two columns:

Col_1 Col_2
XXX-YYY 123
XXX-YYY 120
YYY-QQQ 143

I want to find the minimum in col_2 for each entry in Col_1.

I have done it using a pivot table but would like to be more flexible.

Is there a way of nesting the MIN and an IF statement?

Steve


  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 7
Default MIN IF?

Works a dream - Thanks!

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 35,218
Default MIN IF?

One more if you want to avoid returning a minimum of 0 when there are no
matches.

=IF(COUNTIF(A1:A4,"xxx-yyy")=0,"No matches",MIN(IF(A1:A4="XXX-YYY",B1:B4)))

Still an array formula.

wrote:

I have a table with two columns:

Col_1 Col_2
XXX-YYY 123
XXX-YYY 120
YYY-QQQ 143

I want to find the minimum in col_2 for each entry in Col_1.

I have done it using a pivot table but would like to be more flexible.

Is there a way of nesting the MIN and an IF statement?

Steve


--

Dave Peterson
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



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