Hello
I want to make macro in columns I:N based on cells I2,K2
so if I2,K2 are empty then should populate headers from I:M and insert column OUT in column M to sum column J,L,M based on items are existed in column D.
in column I will brings items from column E as to rest of columns will merge amounts in column F and put under headers for each item in column I
I want macro eal with 11000 rows from columns A:F.
example :
result
and when use dates then should be
NOTE: I would solution by vba . I don't want power query at all.
I want to make macro in columns I:N based on cells I2,K2
so if I2,K2 are empty then should populate headers from I:M and insert column OUT in column M to sum column J,L,M based on items are existed in column D.
in column I will brings items from column E as to rest of columns will merge amounts in column F and put under headers for each item in column I
I want macro eal with 11000 rows from columns A:F.
example :
CVF .xlsx | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | G | H | I | J | K | |||
1 | ITEM | DATE | INVOICE NO | CONDITION | INVOICE TYP | TOTAL | FROM DATE | TO DATE | |||||
2 | 1 | 01/11/2023 | SSLL-001 | PAID | SL | 60,147.00 | |||||||
3 | 2 | 04/11/2023 | SSLL-002 | NOT PAID | SL | 9,504.00 | |||||||
4 | 3 | 05/11/2023 | SSLL-003 | NOT PAID | SL | 7,315.00 | |||||||
5 | 4 | 06/11/2023 | SSLL-004 | NOT PAID | SL | 53,234.00 | |||||||
6 | 5 | 09/11/2023 | SSLL-005 | NOT PAID | SL | 3,706.00 | |||||||
7 | 6 | 10/11/2023 | SSLL-006 | PAID | SL | 2,904.00 | |||||||
8 | 7 | 12/11/2023 | SSLL-007 | CASH BY SAFE | SL | 15,000.00 | |||||||
9 | 8 | 13/11/2023 | SSLL-008 | CASH BY BANK | SL | 32,452.00 | |||||||
10 | 9 | 15/01/2023 | MMLLL-001 | PAID | ML | 1,342.00 | |||||||
11 | 10 | 15/01/2023 | MMLLL-002 | PAID | ML | 2,082.00 | |||||||
12 | 11 | 16/01/2023 | MMLLL-003 | NOT PAID | ML | 3,798.00 | |||||||
13 | 12 | 06/11/2023 | MMLLL-004 | CASH BY BANK | ML | 3,200.00 | |||||||
14 | 13 | 07/11/2023 | MMLLL-005 | CASH BY SAFE | ML | 1,020.00 | |||||||
15 | 14 | 17/11/2023 | TTLL-001 | CASH BY BANK | TL | 12,540.00 | |||||||
16 | 15 | 17/11/2023 | TTLL-002 | NOT PAID | TL | 2,900.00 | |||||||
17 | 16 | 18/11/2023 | TTLL-003 | NOT PAID | TL | 1,500.00 | |||||||
18 | 17 | 18/11/2023 | TTLL-004 | PAID | TL | 2,816.00 | |||||||
19 | 18 | 18/11/2023 | TTLL-005 | PAID | TL | 15,000.00 | |||||||
20 | 19 | 18/11/2023 | TTLL-006 | CASH BY SAFE | TL | 9,450.00 | |||||||
OUT |
result
CVF .xlsx | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | G | H | I | J | K | L | M | N | |||
1 | ITEM | DATE | INVOICE NO | CONDITION | INVOICE TYP | TOTAL | FROM DATE | TO DATE | ||||||||
2 | 1 | 01/11/2023 | SSLL-001 | PAID | SL | 60,147.00 | ||||||||||
3 | 2 | 04/11/2023 | SSLL-002 | NOT PAID | SL | 9,504.00 | ||||||||||
4 | 3 | 05/11/2023 | SSLL-003 | NOT PAID | SL | 7,315.00 | INVOICE TYP | PAID | NOT PAID | CASH BY SAFE | CASH BY BANK | OUT | ||||
5 | 4 | 06/11/2023 | SSLL-004 | NOT PAID | SL | 53,234.00 | SL | 63,501.00 | 73,759.00 | 15,000.00 | 32,452.00 | 110,953.00 | ||||
6 | 5 | 09/11/2023 | SSLL-005 | NOT PAID | SL | 3,706.00 | ML | 3,424.00 | 3,798.00 | 1,020.00 | 3,200.00 | 7,644.00 | ||||
7 | 6 | 10/11/2023 | SSLL-006 | PAID | SL | 2,904.00 | TL | 17,816.00 | 4,400.00 | 9,450.00 | 12,540.00 | 39,806.00 | ||||
8 | 7 | 12/11/2023 | SSLL-007 | CASH BY SAFE | SL | 15,000.00 | TOTAL | 42,261.00 | 81,957.00 | 4,530.00 | 16,712.00 | 63,503.00 | ||||
9 | 8 | 13/11/2023 | SSLL-008 | CASH BY BANK | SL | 32,452.00 | ||||||||||
10 | 9 | 15/01/2023 | MMLLL-001 | PAID | ML | 1,342.00 | ||||||||||
11 | 10 | 15/01/2023 | MMLLL-002 | PAID | ML | 2,082.00 | ||||||||||
12 | 11 | 16/01/2023 | MMLLL-003 | NOT PAID | ML | 3,798.00 | ||||||||||
13 | 12 | 06/11/2023 | MMLLL-004 | CASH BY BANK | ML | 3,200.00 | ||||||||||
14 | 13 | 07/11/2023 | MMLLL-005 | CASH BY SAFE | ML | 1,020.00 | ||||||||||
15 | 14 | 17/11/2023 | TTLL-001 | CASH BY BANK | TL | 12,540.00 | ||||||||||
16 | 15 | 17/11/2023 | TTLL-002 | NOT PAID | TL | 2,900.00 | ||||||||||
17 | 16 | 18/11/2023 | TTLL-003 | NOT PAID | TL | 1,500.00 | ||||||||||
18 | 17 | 18/11/2023 | TTLL-004 | PAID | TL | 2,816.00 | ||||||||||
19 | 18 | 18/11/2023 | TTLL-005 | PAID | TL | 15,000.00 | ||||||||||
20 | 19 | 18/11/2023 | TTLL-006 | CASH BY SAFE | TL | 9,450.00 | ||||||||||
OUT |
Cell Formulas | ||
---|---|---|
Range | Formula | |
N5:N8 | N5 | =J5+L5+M5 |
J8,L8:M8 | J8 | =J5-J6-J7 |
K8 | K8 | =SUM(K5:K7) |
and when use dates then should be
CVF .xlsx | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | G | H | I | J | K | L | M | N | |||
1 | ITEM | DATE | INVOICE NO | CONDITION | INVOICE TYP | TOTAL | FROM DATE | TO DATE | ||||||||
2 | 1 | 01/11/2023 | SSLL-001 | PAID | SL | 60,147.00 | 01/11/2023 | 17/11/2023 | ||||||||
3 | 2 | 04/11/2023 | SSLL-002 | NOT PAID | SL | 9,504.00 | ||||||||||
4 | 3 | 05/11/2023 | SSLL-003 | NOT PAID | SL | 7,315.00 | INVOICE TYP | PAID | NOT PAID | CASH BY SAFE | CASH BY BANK | OUT | ||||
5 | 4 | 06/11/2023 | SSLL-004 | NOT PAID | SL | 53,234.00 | SL | 63,501.00 | 73,759.00 | 15,000.00 | 32,452.00 | 110,953.00 | ||||
6 | 5 | 09/11/2023 | SSLL-005 | NOT PAID | SL | 3,706.00 | ML | 3,424.00 | 3,798.00 | 1,020.00 | 3,200.00 | 7,644.00 | ||||
7 | 6 | 10/11/2023 | SSLL-006 | PAID | SL | 2,904.00 | TL | - | 2,900.00 | - | 12,540.00 | 12,540.00 | ||||
8 | 7 | 12/11/2023 | SSLL-007 | CASH BY SAFE | SL | 15,000.00 | TOTAL | 60,077.00 | 80,457.00 | 13,980.00 | 16,712.00 | 90,769.00 | ||||
9 | 8 | 13/11/2023 | SSLL-008 | CASH BY BANK | SL | 32,452.00 | ||||||||||
10 | 9 | 15/01/2023 | MMLLL-001 | PAID | ML | 1,342.00 | ||||||||||
11 | 10 | 15/01/2023 | MMLLL-002 | PAID | ML | 2,082.00 | ||||||||||
12 | 11 | 16/01/2023 | MMLLL-003 | NOT PAID | ML | 3,798.00 | ||||||||||
13 | 12 | 06/11/2023 | MMLLL-004 | CASH BY BANK | ML | 3,200.00 | ||||||||||
14 | 13 | 07/11/2023 | MMLLL-005 | CASH BY SAFE | ML | 1,020.00 | ||||||||||
15 | 14 | 17/11/2023 | TTLL-001 | CASH BY BANK | TL | 12,540.00 | ||||||||||
16 | 15 | 17/11/2023 | TTLL-002 | NOT PAID | TL | 2,900.00 | ||||||||||
17 | 16 | 18/11/2023 | TTLL-003 | NOT PAID | TL | 1,500.00 | ||||||||||
18 | 17 | 18/11/2023 | TTLL-004 | PAID | TL | 2,816.00 | ||||||||||
19 | 18 | 18/11/2023 | TTLL-005 | PAID | TL | 15,000.00 | ||||||||||
20 | 19 | 18/11/2023 | TTLL-006 | CASH BY SAFE | TL | 9,450.00 | ||||||||||
OUT |
Cell Formulas | ||
---|---|---|
Range | Formula | |
N5:N8 | N5 | =J5+L5+M5 |
J8,L8:M8 | J8 | =J5-J6-J7 |
K8 | K8 | =SUM(K5:K7) |
NOTE: I would solution by vba . I don't want power query at all.