Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 208
Default Exclude 0 from MIN array results

Hello,

I have a MIN array that tests a condition in column A, and then calculates
the minimum value from column B for all the rows in which the condition is
true.

=MIN((A1:A4="CF")*(B1:B4))

And sample data might be something like this:

CF 6
CF 8
WW 10
WW 4

The desired result would be 6, since that is lowest number for any row with
"CF" in it.

However, as I understand Excel performs the calculations, the array contains
values like this:

MIN((TRUE, TRUE, FALSE, FALSE)*(6, 8, 10, 4))

which becomes

MIN((6, 8, 0, 0))

And obviously, the minimum in that set is 0, which is what the function
returns.

How do I get the function to return the lowest of the nonzero numbers?

Thanks
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default Exclude 0 from MIN array results

=IF(MIN(your_expression)=0,SMALL(your_expression,2 ),MIN(your_expression))
--
Gary's Student


"Craig" wrote:

Hello,

I have a MIN array that tests a condition in column A, and then calculates
the minimum value from column B for all the rows in which the condition is
true.

=MIN((A1:A4="CF")*(B1:B4))

And sample data might be something like this:

CF 6
CF 8
WW 10
WW 4

The desired result would be 6, since that is lowest number for any row with
"CF" in it.

However, as I understand Excel performs the calculations, the array contains
values like this:

MIN((TRUE, TRUE, FALSE, FALSE)*(6, 8, 10, 4))

which becomes

MIN((6, 8, 0, 0))

And obviously, the minimum in that set is 0, which is what the function
returns.

How do I get the function to return the lowest of the nonzero numbers?

Thanks

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 418
Default Exclude 0 from MIN array results

Craig wrote:
I have a MIN array that tests a condition in column A, and then calculates
the minimum value from column B for all the rows in which the condition is
true.
=MIN((A1:A4="CF")*(B1:B4))
[....]
The desired result would be 6, since that is lowest number for any row with
"CF" in it.
[....]
And obviously, the minimum in that set is 0, which is what the function
returns.
How do I get the function to return the lowest of the nonzero numbers?


=min(if(A1:A4="CF",B1:B4))

entered as an array function (ctl-shift-Enter), as you did with your
MIN() formulation.

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
defintion of array function R..VENKATARAMAN Excel Discussion (Misc queries) 2 April 21st 06 03:21 AM
Inconsistent Array Count results Suzanne Excel Worksheet Functions 5 April 6th 06 05:02 PM
Positioning Numeric Values Resulting from 6 Column Array Formula Sam via OfficeKB.com Excel Worksheet Functions 2 January 5th 06 02:03 AM
Match Closest Results from Data Array TheRobsterUK Excel Discussion (Misc queries) 2 September 29th 05 01:48 PM
VBA Import of text file & Array parsing of that data Dennis Excel Discussion (Misc queries) 4 November 28th 04 10:20 PM


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