Filpak is same customer but has purchased from two different locations, One being DCM and other TGP. So as the collection responsibility will be of different locations, so they have to appear as two different entities in the last three column as shown.
OK.
In the table above the last three columns have been filled by me manually to show what results I want excel to give automaticlly.
I had to check for correctness...
[TABLE="width: 548"]
<TBODY>[TR]
[TD="class: xl63, width: 112, bgcolor: #00b050"]
Customer
[/TD]
[TD="class: xl63, width: 64, bgcolor: #00b050"]
Com.
[/TD]
[TD="class: xl63, width: 116, bgcolor: #00b050"]
Inv Amount
[/TD]
[TD="class: xl63, width: 118, bgcolor: #00b050"]
Over Due Days
[/TD]
[TD="class: xl63, width: 138, bgcolor: #00b050"]
Customer
[/TD]
[TD="class: xl63, width: 64, bgcolor: #00b050"]
Com.
[/TD]
[TD="class: xl63, width: 118, bgcolor: #00b050"]
Total Amount
[/TD]
[/TR]
[TR]
[TD="class: xl64, width: 112, bgcolor: #92d050"]
Filpak
[/TD]
[TD="class: xl64, width: 64, bgcolor: #92d050"]
DCM
[/TD]
[TD="class: xl66, width: 116, bgcolor: #92d050"]
11,450
[/TD]
[TD="class: xl64, width: 118, bgcolor: #92d050"]
13
[/TD]
[TD="class: xl64, width: 138, bgcolor: #92d050"]
Filpak
[/TD]
[TD="class: xl64, width: 64, bgcolor: #92d050"]
DCM
[/TD]
[TD="class: xl66, width: 118, bgcolor: #92d050"]
11,450
[/TD]
[/TR]
[TR]
[TD="class: xl64, width: 112, bgcolor: #92d050"]
Huntsman
[/TD]
[TD="class: xl64, width: 64, bgcolor: #92d050"]
DCM
[/TD]
[TD="class: xl66, width: 116, bgcolor: #92d050"]
18,210
[/TD]
[TD="class: xl64, width: 118, bgcolor: #92d050"]
62
[/TD]
[TD="class: xl64, width: 138, bgcolor: #92d050"]
Huntsman
[/TD]
[TD="class: xl64, width: 64, bgcolor: #92d050"]
DCM
[/TD]
[TD="class: xl66, width: 118, bgcolor: #92d050"]
59,610
[/TD]
[/TR]
[TR]
[TD="class: xl64, width: 112, bgcolor: #92d050"]
Huntsman
[/TD]
[TD="class: xl64, width: 64, bgcolor: #92d050"]
DCM
[/TD]
[TD="class: xl66, width: 116, bgcolor: #92d050"]
6,000
[/TD]
[TD="class: xl64, width: 118, bgcolor: #92d050"]
84
[/TD]
[TD="class: xl64, width: 138, bgcolor: #92d050"]
Jetinks
[/TD]
[TD="class: xl64, width: 64, bgcolor: #92d050"]
DCM
[/TD]
[TD="class: xl66, width: 118, bgcolor: #92d050"]
12,000
[/TD]
[/TR]
[TR]
[TD="class: xl64, width: 112, bgcolor: #92d050"]
Jetinks
[/TD]
[TD="class: xl64, width: 64, bgcolor: #92d050"]
DCM
[/TD]
[TD="class: xl66, width: 116, bgcolor: #92d050"]
12,000
[/TD]
[TD="class: xl64, width: 118, bgcolor: #92d050"]
94
[/TD]
[TD="class: xl64, width: 138, bgcolor: #92d050"]
Real Drinks
[/TD]
[TD="class: xl64, width: 64, bgcolor: #92d050"]
TGP
[/TD]
[TD="class: xl66, width: 118, bgcolor: #92d050"]
23,450
[/TD]
[/TR]
[TR]
[TD="class: xl64, width: 112, bgcolor: #92d050"]
Huntsman
[/TD]
[TD="class: xl64, width: 64, bgcolor: #92d050"]
DCM
[/TD]
[TD="class: xl66, width: 116, bgcolor: #92d050"]
23,400
[/TD]
[TD="class: xl64, width: 118, bgcolor: #92d050"]
15
[/TD]
[TD="class: xl64, width: 138, bgcolor: #92d050"]
Filpak
[/TD]
[TD="class: xl64, width: 64, bgcolor: #92d050"]
TGP
[/TD]
[TD="class: xl66, width: 118, bgcolor: #92d050"]
23,450
[/TD]
[/TR]
[TR]
[TD="class: xl64, width: 112, bgcolor: #92d050"]
Real Drinks
[/TD]
[TD="class: xl64, width: 64, bgcolor: #92d050"]
TGP
[/TD]
[TD="class: xl66, width: 116, bgcolor: #92d050"]
23,450
[/TD]
[TD="class: xl64, width: 118, bgcolor: #92d050"]
32
[/TD]
[TD="class: xl64, width: 138, bgcolor: #92d050"][/TD]
[TD="class: xl64, width: 64, bgcolor: #92d050"][/TD]
[TD="class: xl66, width: 118, bgcolor: #92d050"][/TD]
[/TR]
[TR]
[TD="class: xl64, width: 112, bgcolor: #92d050"]
Huntsman
[/TD]
[TD="class: xl64, width: 64, bgcolor: #92d050"]
DCM
[/TD]
[TD="class: xl66, width: 116, bgcolor: #92d050"]
12,000
[/TD]
[TD="class: xl64, width: 118, bgcolor: #92d050"]
62
[/TD]
[TD="class: xl65, width: 138, bgcolor: #92d050"][/TD]
[TD="class: xl65, width: 64, bgcolor: #92d050"][/TD]
[TD="class: xl66, width: 118, bgcolor: #92d050"][/TD]
[/TR]
[TR]
[TD="class: xl64, width: 112, bgcolor: #92d050"]
Filpak
[/TD]
[TD="class: xl64, width: 64, bgcolor: #92d050"]
TGP
[/TD]
[TD="class: xl66, width: 116, bgcolor: #92d050"]
23,450
[/TD]
[TD="class: xl64, width: 118, bgcolor: #92d050"]
14
[/TD]
[TD="class: xl65, width: 138, bgcolor: #92d050"][/TD]
[TD="class: xl65, width: 64, bgcolor: #92d050"][/TD]
[TD="class: xl65, width: 118, bgcolor: #92d050"][/TD]
[/TR]
</TBODY>[/TABLE]
Define the following using Formulas | Name Manager:
Customer as:
Com as:
Amount as:
Ivec as:
Rich (BB code):
=ROW(Customer)-ROW(INDEX(Customer,1,1))+1
E2, control+shift+enter (CSE), not just enter, and copy down:
Rich (BB code):
=IFERROR(INDEX(Customer,SMALL(IF(FREQUENCY(IF(Customer<>"",
MATCH(Customer&"|"&Com,Customer&"|"&Com,0)),Ivec),Ivec),
ROWS(E$2:E2))),"")
F2, CSE and copy down:
Rich (BB code):
=IFERROR(INDEX(Com,SMALL(IF(FREQUENCY(IF(Customer<>"",
MATCH(Customer&"|"&Com,Customer&"|"&Com,0)),Ivec),Ivec),
ROWS(F$2:F2))),"")
G2, just enter and copy down:
Rich (BB code):
=IF($E2="","",SUMIFS(Amount,Customer,$E2,Com,$F2))