Finding the maximum number using an if criteria


Posted by Matt on February 12, 2002 4:41 AM

I am trying to write a formula which will tell me how long one of my vendors has had a part. The original spreadsheet has 4 columns and various rows. The columns are P.O., Vendor, PO Cut, Date Returned. What I am trying to do is have Excel look at each unique entry under the vendor column and tell me the longest and the shortest time that a vendor has had a part. I've been trying for over a day now with no success. Any help here would be greatly appreciated.

Thanks,

Matt

Posted by Aladin Akyurek on February 12, 2002 5:30 AM

Matt --

You have a Date Returned column, but that would be not enough to compute a min and/or max duration. What do you have exactly in other columns?

Aladin

==========

Posted by Matt on February 12, 2002 5:40 AM

Aladin,
There is also a column labled turnaround which lists, in workdays, the number of days a part has been out.
Thanks,

Matt

Posted by Aladin Akyurek on February 12, 2002 9:55 AM

Matt --

Instead of bothering you with further questions, I'll cook up in what follows a situation similar to yours (I hope).

Lets say that A1:C6 houses the sample data:

{"Part","Vendor","Turnaround";
"p1","v1",7;
"p2","v1",8;
"p1","v2",5;
"p3","v1",6;
"p1","v1",5}

In F1 enter: p1 [ a part of interest ]
In H1 enter: p2 [ likewise a part of interest ]
In F2 enter: min
In G2 enter: max
In H2 enter: min
In I2 enter: max

In E3 enter: v1
In E4 enter: v2

Notice that I've put parts across in row 1 and vendors (a list of unique items) in E from E3 on.

In F3 array-enter: =MIN(IF(($A$2:$A$6=F$1)*($B$2:$B$6=$E3),($C$2:$C$6)))
In G3 array-enter: =MAX(($A$2:$A$6=F$1)*($B$2:$B$6=$E3)*($C$2:$C$6))

You need to hit control+shift+enter at the same time, insted of just enter, to array-enter a formula.

Now select F3:G3 and drag across as far as needed then down.

The following is what you see in the results area:

{"","p1","","p2","";"","min","max","min","max";"v1",5,7,8,8;"v2",5,5,0,0}

that is, in E1:I4.

Hope this is what you want.

=========== ,



Posted by Matt on February 13, 2002 8:33 AM

Yes, Thank you very very much. -- Instead of bothering you with further questions, I'll cook up in what follows a situation similar to yours (I hope). Lets say that A1:C6 houses the sample data: {"Part","Vendor","Turnaround";