Hi
here is my data in sheet
what I want just macro to do this
when select item by data validation in I2 then merge amounts in column N for duplicates items based on column M and show in J2
I will take value 12 in D2 as example how calculate
step 1=(12/87)=0.137931034
step2= 0.137931034*100=13.7931%
step3=13.7931*200/100=27.58621
step 4=27.58621+12=39.59
for more details
in step 1 value 12 is D2 , 87 will be in last cell in column D
step 3 200 will be in I2 ,as to 100 will be %
result will be in column D
here is my data in sheet
A.xlsm | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | G | I | J | K | L | M | N | ||||
1 | ITEM | DESCRIBE | QTY | PRICE | AMOUNT | DESCRIBE | AMOUNT | DATE | DESCRIBE | AMOUNTS | ||||||
2 | 1 | TTTM 1222 50PCS | 10.00 | 12.00 | 120.00 | 01/01/2024 | Tire installation | 200 | ||||||||
3 | 2 | TTTM 1223 50PCS | 7.00 | 16.00 | 112.00 | 01/01/2024 | Tire patching inside | 100 | ||||||||
4 | 3 | TTTM 1224 100PCS | 4.00 | 11.00 | 44.00 | 02/01/2024 | Tire lead | 200 | ||||||||
5 | 4 | TTTM 1225 80PCS | 5.00 | 6.00 | 30.00 | 02/01/2024 | Tire installation | 100 | ||||||||
6 | 5 | TTTM 1226 100PCS | 10.00 | 10.00 | 100.00 | 03/01/2024 | Tire patching | 120 | ||||||||
7 | 6 | TTTM 1227 20 PCS | 10.00 | 11.00 | 110.00 | 04/01/2024 | Tire patching inside | 100 | ||||||||
8 | 7 | TTTM 1228 25PCS | 15.00 | 6.00 | 90.00 | 05/01/2024 | Tire patching outside | 120 | ||||||||
9 | 8 | TTTM 1229 44 PCS | 25.00 | 5.00 | 125.00 | |||||||||||
10 | 9 | TTTM 1230 35PCS | 20.00 | 10.00 | 200.00 | |||||||||||
11 | TOTAL | 87.00 | 931.00 | |||||||||||||
INVOICE |
Cell Formulas | ||
---|---|---|
Range | Formula | |
E2:E10 | E2 | =C2*D2 |
D11:E11 | D11 | =SUM(D2:D10) |
Cells with Data Validation | ||
---|---|---|
Cell | Allow | Criteria |
I2,R1 | List | =$R$1:$R$4 |
what I want just macro to do this
when select item by data validation in I2 then merge amounts in column N for duplicates items based on column M and show in J2
I will take value 12 in D2 as example how calculate
step 1=(12/87)=0.137931034
step2= 0.137931034*100=13.7931%
step3=13.7931*200/100=27.58621
step 4=27.58621+12=39.59
for more details
in step 1 value 12 is D2 , 87 will be in last cell in column D
step 3 200 will be in I2 ,as to 100 will be %
result will be in column D
A.xlsm | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | G | I | J | K | L | M | N | O | P | ||||
1 | ITEM | DESCRIBE | QTY | PRICE | AMOUNT | DESCRIBE | AMOUNT | DATE | DESCRIBE | AMOUNTS | ||||||||
2 | 1 | TTTM 1222 50PCS | 10.00 | 39.59 | 395.90 | Tire patching inside | 200 | 01/01/2024 | Tire installation | 200 | ||||||||
3 | 2 | TTTM 1223 50PCS | 7.00 | 52.78 | 369.46 | 01/01/2024 | Tire patching inside | 300 | ||||||||||
4 | 3 | TTTM 1224 100PCS | 4.00 | 36.29 | 145.16 | 02/01/2024 | Tire lead | 200 | ||||||||||
5 | 4 | TTTM 1225 80PCS | 5.00 | 19.79 | 98.95 | 02/01/2024 | Tire installation | 100 | ||||||||||
6 | 5 | TTTM 1226 100PCS | 10.00 | 32.99 | 329.90 | 03/01/2024 | Tire patching | 120 | ||||||||||
7 | 6 | TTTM 1227 20 PCS | 10.00 | 36.29 | 362.90 | 04/01/2024 | Tire patching inside | 100 | ||||||||||
8 | 7 | TTTM 1228 25PCS | 15.00 | 19.79 | 296.85 | 05/01/2024 | Tire patching outside | 120 | ||||||||||
9 | 8 | TTTM 1229 44 PCS | 25.00 | 10.75 | 268.75 | |||||||||||||
10 | 9 | TTTM 1230 35PCS | 20.00 | 32.99 | 659.80 | |||||||||||||
11 | TOTAL | 281.26 | 2,927.67 | |||||||||||||||
INVOICE |
Cell Formulas | ||
---|---|---|
Range | Formula | |
E2:E10 | E2 | =C2*D2 |
D11:E11 | D11 | =SUM(D2:D10) |