ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   MINIF? Like SUMIF and COUNTIF (https://www.excelbanter.com/excel-discussion-misc-queries/181104-minif-like-sumif-countif.html)

[email protected]

MINIF? Like SUMIF and COUNTIF
 
Is there a function that would behave similarly to the SUMIF and
COUNTIF functions to find the minimum value in Column B where Column A
equals a specified value?

T. Valko

MINIF? Like SUMIF and COUNTIF
 
There's not a specific function for that but you can write a formula that
uses the MIN and IF functions.

This is an array formula** :

=MIN(IF(A1:A10="x",B1:B10))

=MIN(IF(A1:A10=10,B1:B10))

=MIN(IF(A1:A10=D1,B1:B10))

If a cell in column A meets the condition and the corresponding cell in
column B is empty that will evaluate as 0 and might be evaluated as the MIN
so you'd have to test for empty cells:

=MIN(IF((A1:A10="x")*(B1:B10<""),B1:B10))

=MIN(IF((A1:A10=10)*(B1:B10<""),B1:B10))

=MIN(IF((A1:A10=D1)*(B1:B10<""),B1:B10))

** array formulas need to be entered using the key combination of
CTRL,SHIFT,ENTER (not just ENTER)


--
Biff
Microsoft Excel MVP


wrote in message
...
Is there a function that would behave similarly to the SUMIF and
COUNTIF functions to find the minimum value in Column B where Column A
equals a specified value?




[email protected]

MINIF? Like SUMIF and COUNTIF
 
On Mar 24, 2:18 pm, "T. Valko" wrote:
There's not a specific function for that but you can write a formula that
uses the MIN and IF functions.

This is an array formula** :

=MIN(IF(A1:A10="x",B1:B10))

=MIN(IF(A1:A10=10,B1:B10))

=MIN(IF(A1:A10=D1,B1:B10))

If a cell in column A meets the condition and the corresponding cell in
column B is empty that will evaluate as 0 and might be evaluated as the MIN
so you'd have to test for empty cells:

=MIN(IF((A1:A10="x")*(B1:B10<""),B1:B10))

=MIN(IF((A1:A10=10)*(B1:B10<""),B1:B10))

=MIN(IF((A1:A10=D1)*(B1:B10<""),B1:B10))

** array formulas need to be entered using the key combination of
CTRL,SHIFT,ENTER (not just ENTER)

--
Biff
Microsoft Excel MVP

wrote in message

...

Is there a function that would behave similarly to the SUMIF and
COUNTIF functions to find the minimum value in Column B where Column A
equals a specified value?


That's exactly what I needed. Thanks.

T. Valko

MINIF? Like SUMIF and COUNTIF
 
wrote in message
...
On Mar 24, 2:18 pm, "T. Valko" wrote:
There's not a specific function for that but you can write a formula that
uses the MIN and IF functions.

This is an array formula** :

=MIN(IF(A1:A10="x",B1:B10))

=MIN(IF(A1:A10=10,B1:B10))

=MIN(IF(A1:A10=D1,B1:B10))

If a cell in column A meets the condition and the corresponding cell in
column B is empty that will evaluate as 0 and might be evaluated as the
MIN
so you'd have to test for empty cells:

=MIN(IF((A1:A10="x")*(B1:B10<""),B1:B10))

=MIN(IF((A1:A10=10)*(B1:B10<""),B1:B10))

=MIN(IF((A1:A10=D1)*(B1:B10<""),B1:B10))

** array formulas need to be entered using the key combination of
CTRL,SHIFT,ENTER (not just ENTER)

--
Biff
Microsoft Excel MVP

wrote in message

...

Is there a function that would behave similarly to the SUMIF and
COUNTIF functions to find the minimum value in Column B where Column A
equals a specified value?


That's exactly what I needed. Thanks.


You're welcome. Thanks for the feedback!

--
Biff
Microsoft Excel MVP




All times are GMT +1. The time now is 01:31 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com