Hi
I have many data contains blank row , should split data for each range based on end blank row
each range start data from first row and finish at blank row .
when split data should merge duplicates items and sum amounts for debit and credit and calculation by column BALANCE and I don't need any formula in column L
the result should be H:L.
every time I will add new data in columns A:D , should delete data H:L when run the macro every time .
I Have about 3500 rows .
result
M(J17:J19)[/XD][/XR][XR][XD]J24:K24[/XD][XD=fw:b]J24[/XD][XD]=SUM(J23:J23)[/XD][/XR][/RANGE]
I have many data contains blank row , should split data for each range based on end blank row
each range start data from first row and finish at blank row .
when split data should merge duplicates items and sum amounts for debit and credit and calculation by column BALANCE and I don't need any formula in column L
the result should be H:L.
every time I will add new data in columns A:D , should delete data H:L when run the macro every time .
I Have about 3500 rows .
AGGREGATE1.xlsm | ||||||
---|---|---|---|---|---|---|
A | B | C | D | |||
1 | DATE | ACCOUNT NAME | DEBIT | CREDIT | ||
2 | 01/03/2023 | CASH BALANCE | 200,000.00 | |||
3 | 03/03/2023 | CASH PR | 2,000.00 | |||
4 | 03/03/2023 | CASH PR | 15,000.00 | |||
5 | 09/03/2023 | CASH PR | 500.00 | |||
6 | 13/03/2023 | CASH PR | 10,000.00 | |||
7 | 13/03/2023 | CASH PR | 15,000.00 | |||
8 | 14/03/2023 | CASH PR | 500.00 | |||
9 | 19/03/2023 | CASH PR | 500.00 | |||
10 | 19/03/2023 | CASH PR | 2,000.00 | |||
11 | 05/03/2023 | CASH DM | 2,000.00 | |||
12 | 10/03/2023 | CASH DM | 500.00 | |||
13 | 15/03/2023 | CASH DM | 5,000.00 | |||
14 | 15/03/2023 | CASH DM | 2,000.00 | |||
15 | 15/03/2023 | CASH DM | 10,000.00 | |||
16 | 18/03/2023 | CASH DM | 25,000.00 | |||
17 | 19/03/2023 | CASH DM | 2,000.00 | |||
18 | 07/04/2023 | EXPENSE ADMIN | 55000 | |||
19 | 08/04/2023 | EXPENSE ADMIN | 10000 | |||
20 | ||||||
21 | 25/03/2023 | PURCHASE | 10000 | |||
22 | 29/03/2023 | PURCHASE | 5000 | |||
23 | 09/04/2023 | STOCK1 | 100000 | |||
24 | 30/03/2023 | PURCHASE RETURNS | 2000 | |||
25 | 31/03/2023 | PURCHASE RETURNS | 2000 | |||
26 | 03/04/2023 | PURCHASE LOW | 4000 | |||
27 | 04/04/2023 | PURCHASE LOW | 2200 | |||
28 | 21/03/2023 | EXPENSE PR | 15,000.00 | |||
29 | 21/03/2023 | EXPENSE PR | 20,000.00 | |||
30 | 23/03/2023 | EXPENSE PR | 2,000.00 | |||
31 | ||||||
32 | 24/03/2023 | SALES | 200000 | |||
33 | 26/03/2023 | SALES | 1000 | |||
34 | 27/03/2023 | SALES RETURNS | 2500 | |||
35 | 28/03/2023 | SALES RETURNS | 1000 | |||
36 | 01/04/2023 | SELLING LOW | 2000 | |||
37 | 02/04/2023 | SELLING LOW | 1200 | |||
38 | ||||||
39 | 05/04/2023 | STOCK | 70000 | |||
40 | 06/04/2023 | STOCK | 130000 | |||
41 | ||||||
DAILY |
result
AGGREGATE1.xlsm | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | G | H | I | J | K | L | |||
1 | DATE | ACCOUNT NAME | DEBIT | CREDIT | ITEM | ACCOUNT NAME | DEBIT | CREDIT | BALANCE | |||||
2 | 01/03/2023 | CASH BALANCE | 200,000.00 | 1 | CASH BALANCE | 200,000.00 | 200,000.00 | |||||||
3 | 03/03/2023 | CASH PR | 2,000.00 | 2 | CASH PR | 15,000.00 | 30,500.00 | 184,500.00 | ||||||
4 | 03/03/2023 | CASH PR | 15,000.00 | 3 | CASH DM | 9,500.00 | 37,000.00 | 157,000.00 | ||||||
5 | 09/03/2023 | CASH PR | 500.00 | 4 | EXPENSE ADMIN | 65,000.00 | 92,000.00 | |||||||
6 | 13/03/2023 | CASH PR | 10,000.00 | TOTAL | 224,500.00 | 132,500.00 | 92,000.00 | |||||||
7 | 13/03/2023 | CASH PR | 15,000.00 | |||||||||||
8 | 14/03/2023 | CASH PR | 500.00 | ITEM | ACCOUNT NAME | DEBIT | CREDIT | BALANCE | ||||||
9 | 19/03/2023 | CASH PR | 500.00 | 1 | PURCHASE | 15,000.00 | 15,000.00 | |||||||
10 | 19/03/2023 | CASH PR | 2,000.00 | 2 | STOCK1 | 100,000.00 | 115,000.00 | |||||||
11 | 05/03/2023 | CASH DM | 2,000.00 | 3 | PURCHASE RETURNS | 4,000.00 | 111,000.00 | |||||||
12 | 10/03/2023 | CASH DM | 500.00 | 4 | PURCHASE LOW | 6,200.00 | 117,200.00 | |||||||
13 | 15/03/2023 | CASH DM | 5,000.00 | 5 | EXPENSE PR | 37,000.00 | 154,200.00 | |||||||
14 | 15/03/2023 | CASH DM | 2,000.00 | TOTAL | 158,200.00 | 4,000.00 | 154,200.00 | |||||||
15 | 15/03/2023 | CASH DM | 10,000.00 | |||||||||||
16 | 18/03/2023 | CASH DM | 25,000.00 | ITEM | ACCOUNT NAME | DEBIT | CREDIT | BALANCE | ||||||
17 | 19/03/2023 | CASH DM | 2,000.00 | 1 | SALES | 201,000.00 | -201,000.00 | |||||||
18 | 07/04/2023 | EXPENSE ADMIN | 55000 | 2 | SALES RETURNS | 3,500.00 | -197,500.00 | |||||||
19 | 08/04/2023 | EXPENSE ADMIN | 10000 | 3 | SELLING LOW | 3,200.00 | -200,700.00 | |||||||
20 | TOTAL | 3,500.00 | 204,200.00 | -200,700.00 | ||||||||||
21 | 25/03/2023 | PURCHASE | 10000 | |||||||||||
22 | 29/03/2023 | PURCHASE | 5000 | ITEM | ACCOUNT NAME | DEBIT | CREDIT | BALANCE | ||||||
23 | 09/04/2023 | STOCK1 | 100000 | 1 | STOCK | 200,000.00 | 200,000.00 | |||||||
24 | 30/03/2023 | PURCHASE RETURNS | 2000 | TOTAL | 200,000.00 | 0.00 | 200,000.00 | |||||||
25 | 31/03/2023 | PURCHASE RETURNS | 2000 | |||||||||||
26 | 03/04/2023 | PURCHASE LOW | 4000 | |||||||||||
27 | 04/04/2023 | PURCHASE LOW | 2200 | |||||||||||
28 | 21/03/2023 | EXPENSE PR | 15,000.00 | |||||||||||
29 | 21/03/2023 | EXPENSE PR | 20,000.00 | |||||||||||
30 | 23/03/2023 | EXPENSE PR | 2,000.00 | |||||||||||
31 | ||||||||||||||
32 | 24/03/2023 | SALES | 200000 | |||||||||||
33 | 26/03/2023 | SALES | 1000 | |||||||||||
34 | 27/03/2023 | SALES RETURNS | 2500 | |||||||||||
35 | 28/03/2023 | SALES RETURNS | 1000 | |||||||||||
36 | 01/04/2023 | SELLING LOW | 2000 | |||||||||||
37 | 02/04/2023 | SELLING LOW | 1200 | |||||||||||
38 | ||||||||||||||
39 | 05/04/2023 | STOCK | 70000 | |||||||||||
40 | 06/04/2023 | STOCK | 130000 | |||||||||||
41 | ||||||||||||||
DAILY |
Cell Formulas | ||
---|---|---|
Range | Formula | |
L2,L23:L24,L20,L17,L14,L9,L6 | L2 | =J2-K2 |
L18:L19,L10:L13,L3:L5 | L3 | =L2+J3-K3 |
J6:K6 | J6 | =SUM(J2:J5) |
J14:K14 | J14 | =SUM(J9:J13) |
J20:K20 | J20 | =SUM(J17:J19) |
J24:K24 | J24 | =SUM(J23:J23) |
AGGREGATE1.xlsm | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | G | H | I | J | K | L | |||
1 | DATE | ACCOUNT NAME | DEBIT | CREDIT | ITEM | ACCOUNT NAME | DEBIT | CREDIT | BALANCE | |||||
2 | 01/03/2023 | CASH BALANCE | 200,000.00 | 1 | CASH BALANCE | 200,000.00 | 200,000.00 | |||||||
3 | 03/03/2023 | CASH PR | 2,000.00 | 2 | CASH PR | 15,000.00 | 30,500.00 | 184,500.00 | ||||||
4 | 03/03/2023 | CASH PR | 15,000.00 | 3 | CASH DM | 9,500.00 | 37,000.00 | 157,000.00 | ||||||
5 | 09/03/2023 | CASH PR | 500.00 | 4 | EXPENSE ADMIN | 65,000.00 | 92,000.00 | |||||||
6 | 13/03/2023 | CASH PR | 10,000.00 | TOTAL | 224,500.00 | 132,500.00 | 92,000.00 | |||||||
7 | 13/03/2023 | CASH PR | 15,000.00 | |||||||||||
8 | 14/03/2023 | CASH PR | 500.00 | ITEM | ACCOUNT NAME | DEBIT | CREDIT | BALANCE | ||||||
9 | 19/03/2023 | CASH PR | 500.00 | 1 | PURCHASE | 15,000.00 | 15,000.00 | |||||||
10 | 19/03/2023 | CASH PR | 2,000.00 | 2 | STOCK1 | 100,000.00 | 115,000.00 | |||||||
11 | 05/03/2023 | CASH DM | 2,000.00 | 3 | PURCHASE RETURNS | 4,000.00 | 111,000.00 | |||||||
12 | 10/03/2023 | CASH DM | 500.00 | 4 | PURCHASE LOW | 6,200.00 | 117,200.00 | |||||||
13 | 15/03/2023 | CASH DM | 5,000.00 | 5 | EXPENSE PR | 37,000.00 | 154,200.00 | |||||||
14 | 15/03/2023 | CASH DM | 2,000.00 | TOTAL | 158,200.00 | 4,000.00 | 154,200.00 | |||||||
15 | 15/03/2023 | CASH DM | 10,000.00 | |||||||||||
16 | 18/03/2023 | CASH DM | 25,000.00 | ITEM | ACCOUNT NAME | DEBIT | CREDIT | BALANCE | ||||||
17 | 19/03/2023 | CASH DM | 2,000.00 | 1 | SALES | 201,000.00 | -201,000.00 | |||||||
18 | 07/04/2023 | EXPENSE ADMIN | 55000 | 2 | SALES RETURNS | 3,500.00 | -197,500.00 | |||||||
19 | 08/04/2023 | EXPENSE ADMIN | 10000 | 3 | SELLING LOW | 3,200.00 | -200,700.00 | |||||||
20 | TOTAL | 3,500.00 | 204,200.00 | -200,700.00 | ||||||||||
21 | 25/03/2023 | PURCHASE | 10000 | |||||||||||
22 | 29/03/2023 | PURCHASE | 5000 | ITEM | ACCOUNT NAME | DEBIT | CREDIT | BALANCE | ||||||
23 | 09/04/2023 | STOCK1 | 100000 | 1 | STOCK | 200,000.00 | 200,000.00 | |||||||
24 | 30/03/2023 | PURCHASE RETURNS | 2000 | TOTAL | 200,000.00 | 0.00 | 200,000.00 | |||||||
25 | 31/03/2023 | PURCHASE RETURNS | 2000 | |||||||||||
26 | 03/04/2023 | PURCHASE LOW | 4000 | |||||||||||
27 | 04/04/2023 | PURCHASE LOW | 2200 | |||||||||||
28 | 21/03/2023 | EXPENSE PR | 15,000.00 | |||||||||||
29 | 21/03/2023 | EXPENSE PR | 20,000.00 | |||||||||||
30 | 23/03/2023 | EXPENSE PR | 2,000.00 | |||||||||||
31 | ||||||||||||||
32 | 24/03/2023 | SALES | 200000 | |||||||||||
33 | 26/03/2023 | SALES | 1000 | |||||||||||
34 | 27/03/2023 | SALES RETURNS | 2500 | |||||||||||
35 | 28/03/2023 | SALES RETURNS | 1000 | |||||||||||
36 | 01/04/2023 | SELLING LOW | 2000 | |||||||||||
37 | 02/04/2023 | SELLING LOW | 1200 | |||||||||||
38 | ||||||||||||||
39 | 05/04/2023 | STOCK | 70000 | |||||||||||
40 | 06/04/2023 | STOCK | 130000 | |||||||||||
41 | ||||||||||||||
DAILY |
Cell Formulas | ||
---|---|---|
Range | Formula | |
L2,L23:L24,L20,L17,L14,L9,L6 | L2 | =J2-K2 |
L18:L19,L10:L13,L3:L5 | L3 | =L2+J3-K3 |
J6:K6 | J6 | =SUM(J2:J5) |
J14:K14 | J14 | =SUM(J9:J13) |
J20:K20 | J20 | =SUM(J17:J19) |
J24:K24 | J24 | =SUM(J23:J23) |