Trouble with multiple criteria array in XL10

larsonnj

New Member
Joined
Jul 8, 2014
Messages
5
I am trying to draw some analysis from a long list of different sales made to see how often each client returns to make a new purchase. I have made an array which works for a single criteria, but now I am looking to add a second criteria.

[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]Company Name[/TD]
[TD]1st Sale[/TD]
[TD]2nd Sale[/TD]
[TD]3rd Sale[/TD]
[TD]4th Sale[/TD]
[/TR]
[TR]
[TD]Company X[/TD]
[TD]02/07/2010[/TD]
[TD]07/13/2012[/TD]
[TD]08/10/2014[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Company Y[/TD]
[TD]04/23/2009[/TD]
[TD]04/15/2011[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]

My out put table looks similar to the above (with a lot more entries). The formula I used for the single criteria is the following (this works):

=IFERROR(INDEX(Sales!$E$6:$E$2501, SMALL(IF($A152=Sales!$C$6:$C$2501, ROW(Sales!$C$6:$C$2501)-MIN(ROW(Sales!$E$6:$E$2501))+1, ""), COLUMN(A1))),"")

In column E of the Sales tab is listed the date of the sale, and C lists the company name. Column A of the sheet I am working on has a unique list of all previous customers. This formula works fine. Now I want to also be able to screen for a specific type of sale which is listed on the Sales sheet in column D.

I tried using the following formula but it gives me a #VALUE! error.

=IFERROR(INDEX(Sales!$E$6:$E$2501, SMALL(IF(And($A151=Sales!$C$6:$C$2501, $B$139=Sales!$D$6:$C$2501), ROW(Sales!$C$6:$C$2501)-MIN(ROW(Sales!$E$6:$E$2501))+1, ""), COLUMN(A1))),"")

The bold part is the part I have changed in an attempt to not only validate the company name but also the type (which I have input into B139).

I hope this makes sense. Any advice for creating the formula to check for more than one criteria before populating the array?
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
I figured this one out. Just needed to add a couple more if statements into the formula and it works just fine.
 
Upvote 0

Forum statistics

Threads
1,223,227
Messages
6,170,849
Members
452,361
Latest member
d3ad3y3

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.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

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

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

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
Back
Top