Question

I am developing a personal finance spreadsheet and want to return values from a range of data which satisfies multiple criteria.

I want the spreadsheet to return the smallest value greater than zero which is of the type CREDIT.

I have tried a few combinations of the MIN function, but to no avail.

I want something along the lines of:

IF(value>0)
AND(type="CREDIT")
RETURN(value)

**UPDATE**

Example: Say I have one hundred values within the range value, of which ten belong to the type CREDIT and three of those ten are less than zero - I want to return the smallest value which is greater than zero.

How can this be achieved?

Was it helpful?

Solution

With data like:

sample

Use the array formula:

=MIN(IF((B1:B10="Credit")*(A1:A10>0),A1:A10))

Array formulas must be entered with Ctrl + Shift + Enter rather than just the Enter key.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top