abdo meghari
Well-known Member
- Joined
- Aug 3, 2021
- Messages
- 612
- Office Version
- 2019
Hello
I have about four ranges , every range could contain 5000 rows .
the ranges will be in columns A:D and I want merging ranges based on duplicates dates and the same words for duplicates date
so the duplicate date & NOT PAID should merge alone . also the duplicate date & PAID should merge alone . the merging ranges will be based on column B,C
the result should be in columns F:I and should delete ranges(F:I) when run the macro every time before merging .
before
after
I have about four ranges , every range could contain 5000 rows .
the ranges will be in columns A:D and I want merging ranges based on duplicates dates and the same words for duplicates date
so the duplicate date & NOT PAID should merge alone . also the duplicate date & PAID should merge alone . the merging ranges will be based on column B,C
the result should be in columns F:I and should delete ranges(F:I) when run the macro every time before merging .
before
MERGE RANGES.xlsm | ||||||
---|---|---|---|---|---|---|
A | B | C | D | |||
1 | SR | |||||
2 | ITEM | DATE | TYPE | TOTAL | ||
3 | 1 | 2023/06/10 | NOT PAID | 7,720.00 | ||
4 | 2 | 2023/06/10 | NOT PAID | 2,000.00 | ||
5 | 3 | 2023/06/10 | PAID | 6,810.00 | ||
6 | 4 | 2023/06/10 | PAID | 4,000.00 | ||
7 | 5 | 2023/06/11 | NOT PAID | 7,000.00 | ||
8 | SUM | 27,530.00 | ||||
9 | ||||||
10 | SVR | |||||
11 | ITEM | DATE | TYPE | TOTAL | ||
12 | 1 | 2023/06/10 | NOT PAID | 5,720.00 | ||
13 | 2 | 2023/06/10 | PAID | 14,040.00 | ||
14 | 3 | 2023/06/11 | NOT PAID | 1,230.00 | ||
15 | 4 | 2023/06/11 | NOT PAID | 12,000.00 | ||
16 | 5 | 2023/06/12 | PAID | 14,000.00 | ||
17 | 6 | 2023/06/12 | PAID | 1,000.00 | ||
18 | SUM | 47,990.00 | ||||
19 | ||||||
20 | ||||||
21 | SDE | |||||
22 | ITEM | DATE | TYPE | TOTAL | ||
23 | 1 | 2023/06/10 | PAID | 4,000.00 | ||
24 | 2 | 2023/06/10 | PAID | 1,000.00 | ||
25 | 3 | 2023/06/11 | PAID | 2,000.00 | ||
26 | 4 | 2023/06/11 | NOT PAID | 2,200.00 | ||
27 | 5 | 2023/06/12 | NOT PAID | 3,000.00 | ||
28 | SUM | 12,200.00 | ||||
29 | ||||||
30 | ||||||
31 | FGR | |||||
32 | ITEM | DATE | TYPE | TOTAL | ||
33 | 1 | 2023/06/10 | PAID | 1,200.00 | ||
34 | 2 | 2023/06/10 | PAID | 1,300.00 | ||
35 | 3 | 2023/06/11 | NOT PAID | 1,100.00 | ||
36 | 4 | 2023/06/12 | NOT PAID | 2,200.00 | ||
37 | 5 | 2023/06/12 | NOT PAID | 7,000.00 | ||
38 | SUM | 12,800.00 | ||||
REPORT |
Cell Formulas | ||
---|---|---|
Range | Formula | |
D8,D38,D28 | D8 | =SUM(D3:D7) |
D18 | D18 | =SUM(D12:D17) |
after
MERGE RANGES.xlsm | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | G | H | I | |||
1 | SR | SR | |||||||||
2 | ITEM | DATE | TYPE | TOTAL | ITEM | DATE | NOT PAID | PAID | |||
3 | 1 | 2023/06/10 | NOT PAID | 7,720.00 | 1 | 2023/06/10 | 9,720.00 | 10,810.00 | |||
4 | 2 | 2023/06/10 | NOT PAID | 2,000.00 | 2 | 2023/06/11 | 7000 | 0.00 | |||
5 | 3 | 2023/06/10 | PAID | 6,810.00 | SUM | 16,720.00 | 10,810.00 | ||||
6 | 4 | 2023/06/10 | PAID | 4,000.00 | |||||||
7 | 5 | 2023/06/11 | NOT PAID | 7,000.00 | SVR | ||||||
8 | SUM | 27,530.00 | ITEM | DATE | NOT PAID | PAID | |||||
9 | 1 | 2023/06/10 | 5,720.00 | 14,040.00 | |||||||
10 | SVR | 2 | 2023/06/11 | 13,230.00 | 0.00 | ||||||
11 | ITEM | DATE | TYPE | TOTAL | 3 | 2023/06/12 | 0.00 | 15,000.00 | |||
12 | 1 | 2023/06/10 | NOT PAID | 5,720.00 | SUM | 18,950.00 | 29,040.00 | ||||
13 | 2 | 2023/06/10 | PAID | 14,040.00 | |||||||
14 | 3 | 2023/06/11 | NOT PAID | 1,230.00 | SDE | ||||||
15 | 4 | 2023/06/11 | NOT PAID | 12,000.00 | ITEM | DATE | NOT PAID | PAID | |||
16 | 5 | 2023/06/12 | PAID | 14,000.00 | 1 | 2023/06/10 | 0.00 | 5,000.00 | |||
17 | 6 | 2023/06/12 | PAID | 1,000.00 | 2 | 2023/06/11 | 0.00 | 2,000.00 | |||
18 | SUM | 47,990.00 | 3 | 2023/06/11 | 2,200.00 | 0.00 | |||||
19 | 4 | 2023/06/12 | 3,000.00 | 0.00 | |||||||
20 | SUM | 5,200.00 | 7,000.00 | ||||||||
21 | SDE | ||||||||||
22 | ITEM | DATE | TYPE | TOTAL | FGR | ||||||
23 | 1 | 2023/06/10 | PAID | 4,000.00 | ITEM | DATE | NOT PAID | PAID | |||
24 | 2 | 2023/06/10 | PAID | 1,000.00 | 1 | 2023/06/10 | 0.00 | 2,500.00 | |||
25 | 3 | 2023/06/11 | PAID | 2,000.00 | 2 | 2023/06/11 | 1,100.00 | 0.00 | |||
26 | 4 | 2023/06/11 | NOT PAID | 2,200.00 | 3 | 2023/06/12 | 9,200.00 | 0.00 | |||
27 | 5 | 2023/06/12 | NOT PAID | 3,000.00 | SUM | 10,300.00 | 2,500.00 | ||||
28 | SUM | 12,200.00 | |||||||||
29 | |||||||||||
30 | |||||||||||
31 | FGR | ||||||||||
32 | ITEM | DATE | TYPE | TOTAL | |||||||
33 | 1 | 2023/06/10 | PAID | 1,200.00 | |||||||
34 | 2 | 2023/06/10 | PAID | 1,300.00 | |||||||
35 | 3 | 2023/06/11 | NOT PAID | 1,100.00 | |||||||
36 | 4 | 2023/06/12 | NOT PAID | 2,200.00 | |||||||
37 | 5 | 2023/06/12 | NOT PAID | 7,000.00 | |||||||
38 | SUM | 12,800.00 | |||||||||
REPORT |
Cell Formulas | ||
---|---|---|
Range | Formula | |
H5:I5 | H5 | =SUM(H3:H4) |
D8,D38,D28 | D8 | =SUM(D3:D7) |
H27:I27,H12:I12 | H12 | =SUM(H9:H11) |
D18 | D18 | =SUM(D12:D17) |
H20:I20 | H20 | =SUM(H16:H19) |