Determine the right formula

canthony24

Board Regular
Joined
Mar 24, 2016
Messages
70
I have a very large data set, over 600k rows, that will eventually be a pivot table, but I want to summarize the data. Creating a pivot table and trying to summarize using that isn't working. I need to figure out whats the count of customers that receive 4 or more cases in a single delivery.

The data set is rather small as far as columns. Columns include Customer Name, Invoice Date, Invoice Number, Year and Cases Sold. The dates are random and the invoices are random.
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
Control+shift+enter, not just enter:

=SUM(IF(FREQUENCY(IF(1-(Customer=""),IF(CaseAmount>=4,MATCH(Customer,Customer,0))),ROW(Customer)-ROW(INDEX(Customer,1,1))+1),1))

Hope this helps.
 
Upvote 0
I'm testing it now. Is there a way to run the formula down the end of the last column to call out which customers they are?
 
Upvote 0
Precisely. That way I can find the average case amount per invoice.

Let's A1 in a sheet, which is different from the one with the source data, house the first formula, i.e.

=SUM(IF(FREQUENCY(IF(1-(Customer=""),IF(CaseAmount>=4,MATCH(Customer,Customer,0))),ROW(Customer)-ROW(INDEX(Customer,1,1))+1),1))

In A3 control+shift+enter, not just enter, and copy down:

=IF(ROWS($A$3:A3)>$A$1,"",INDEX(Customer,SMALL(IF(FREQUENCY(IF(1-(Customer=""),IF(CaseAmount>=4,MATCH(Customer,Customer,0))),ROW(Customer)-ROW(INDEX(Customer,1,1))+1),ROW(Customer)-ROW(INDEX(Customer,1,1))+1),ROWS($A$3:A3))))
 
Upvote 0

Forum statistics

Threads
1,223,948
Messages
6,175,571
Members
452,652
Latest member
eduedu

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