Hello-
I've been searching forums all morning trying to find a way to find a way to get the minimum value using two criteria. Here's a sample of what my data looks like, and ideally what I'd like to see as a result.
[TABLE="width: 500"]
<tbody>[TR]
[TD]Case #
[/TD]
[TD]Size
[/TD]
[TD]Date
[/TD]
[/TR]
[TR]
[TD]1
[/TD]
[TD]Small
[/TD]
[TD]201501
[/TD]
[/TR]
[TR]
[TD]1
[/TD]
[TD]Small
[/TD]
[TD]201512
[/TD]
[/TR]
[TR]
[TD]1
[/TD]
[TD]Large
[/TD]
[TD]201503
[/TD]
[/TR]
[TR]
[TD]1
[/TD]
[TD]Large
[/TD]
[TD]201508
[/TD]
[/TR]
[TR]
[TD]1
[/TD]
[TD]Large
[/TD]
[TD]201511
[/TD]
[/TR]
[TR]
[TD]2
[/TD]
[TD]Large
[/TD]
[TD]201507
[/TD]
[/TR]
[TR]
[TD]2
[/TD]
[TD]Large
[/TD]
[TD]201511
[/TD]
[/TR]
[TR]
[TD]2
[/TD]
[TD]Small
[/TD]
[TD]201503
[/TD]
[/TR]
[TR]
[TD]2
[/TD]
[TD]Small
[/TD]
[TD]201508
[/TD]
[/TR]
[TR]
[TD]2
[/TD]
[TD]Small
[/TD]
[TD]201501
[/TD]
[/TR]
</tbody>[/TABLE]
Ideal output:
[TABLE="width: 500"]
<tbody>[TR]
[TD]Case #
[/TD]
[TD]Size
[/TD]
[TD]Min
[/TD]
[TD]Max
[/TD]
[/TR]
[TR]
[TD]1
[/TD]
[TD]Small
[/TD]
[TD]201501
[/TD]
[TD]201512
[/TD]
[/TR]
[TR]
[TD]1
[/TD]
[TD]Large
[/TD]
[TD]201503
[/TD]
[TD]201511
[/TD]
[/TR]
[TR]
[TD]2
[/TD]
[TD]Small
[/TD]
[TD]201501
[/TD]
[TD]201508
[/TD]
[/TR]
[TR]
[TD]2
[/TD]
[TD]Large
[/TD]
[TD]201507
[/TD]
[TD]201511
[/TD]
[/TR]
</tbody>[/TABLE]
I am familiar with Arrays, and I have done a Max(if( nested statement to get the results I need, but I'm also building a macro that will loop through my output (could be 100k+ rows) and the Array Formula just doesn't seem efficient.
Is there a way to write some VBA code to loop through and find the min based on two criteria (Case # and Size)??
I've been searching forums all morning trying to find a way to find a way to get the minimum value using two criteria. Here's a sample of what my data looks like, and ideally what I'd like to see as a result.
[TABLE="width: 500"]
<tbody>[TR]
[TD]Case #
[/TD]
[TD]Size
[/TD]
[TD]Date
[/TD]
[/TR]
[TR]
[TD]1
[/TD]
[TD]Small
[/TD]
[TD]201501
[/TD]
[/TR]
[TR]
[TD]1
[/TD]
[TD]Small
[/TD]
[TD]201512
[/TD]
[/TR]
[TR]
[TD]1
[/TD]
[TD]Large
[/TD]
[TD]201503
[/TD]
[/TR]
[TR]
[TD]1
[/TD]
[TD]Large
[/TD]
[TD]201508
[/TD]
[/TR]
[TR]
[TD]1
[/TD]
[TD]Large
[/TD]
[TD]201511
[/TD]
[/TR]
[TR]
[TD]2
[/TD]
[TD]Large
[/TD]
[TD]201507
[/TD]
[/TR]
[TR]
[TD]2
[/TD]
[TD]Large
[/TD]
[TD]201511
[/TD]
[/TR]
[TR]
[TD]2
[/TD]
[TD]Small
[/TD]
[TD]201503
[/TD]
[/TR]
[TR]
[TD]2
[/TD]
[TD]Small
[/TD]
[TD]201508
[/TD]
[/TR]
[TR]
[TD]2
[/TD]
[TD]Small
[/TD]
[TD]201501
[/TD]
[/TR]
</tbody>[/TABLE]
Ideal output:
[TABLE="width: 500"]
<tbody>[TR]
[TD]Case #
[/TD]
[TD]Size
[/TD]
[TD]Min
[/TD]
[TD]Max
[/TD]
[/TR]
[TR]
[TD]1
[/TD]
[TD]Small
[/TD]
[TD]201501
[/TD]
[TD]201512
[/TD]
[/TR]
[TR]
[TD]1
[/TD]
[TD]Large
[/TD]
[TD]201503
[/TD]
[TD]201511
[/TD]
[/TR]
[TR]
[TD]2
[/TD]
[TD]Small
[/TD]
[TD]201501
[/TD]
[TD]201508
[/TD]
[/TR]
[TR]
[TD]2
[/TD]
[TD]Large
[/TD]
[TD]201507
[/TD]
[TD]201511
[/TD]
[/TR]
</tbody>[/TABLE]
I am familiar with Arrays, and I have done a Max(if( nested statement to get the results I need, but I'm also building a macro that will loop through my output (could be 100k+ rows) and the Array Formula just doesn't seem efficient.
Is there a way to write some VBA code to loop through and find the min based on two criteria (Case # and Size)??