# Array MIN that ignores zeros

#### Silverjman

##### Board Regular
{=MIN((\$A122=\$A\$2:\$A\$2841)*\$S\$2:\$S\$2841)}
Column A is names S Dates so the result of this formula is Jan1901 or 0. COUNTIFS don't work in array formulas, correct? So I can't use SMALL(XXXXXXXX,COUNTIFS(XXX,0)+1)

I'm trying to find the first date a name appears...Mucho thanks!

### Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"

#### gsistek

##### Well-known Member
Try using
{=MIN(IF(\$A\$2:\$A\$2841=\$A122,\$S\$2:\$S\$2841,9E+307))}

*Array entered formulas are entered using CTRL-SHIFT-ENTER instead of just ENTER. If done correctly, Excel will insert the curly braces around your formula.

#### barry houdini

##### MrExcel MVP
Try it like this:

=MIN(IF(\$A122=\$A\$2:\$A\$2841,\$S\$2:\$S\$2841))

#### Mike LH

##### Well-known Member
Hi,

Try this, it's an ARRAY so ctrl+shift+enter

=MIN(IF(A2:A2841=A122,IF(S2:S2841>0,S2:S2841)))

#### Silverjman

##### Board Regular
AHHHHHH THANKS Mike, I danced around that for an embarrassingly long time but was not going to get it, now I can sleep tonight!

Gsistek I am very confused by the "9E+307" I tried hard to get it to work for the range but alas

Barry, I had been trying that earlier to no avail

Thanks ALL, your generosity is/was much appreciated!!!!!!!!!!!!!!!

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

1,164,626
Messages
5,838,431
Members
430,547
Latest member
jopshio

### We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.

### Which adblocker are you using?

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

### Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

### Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back