Dear All Master,
I want to change the formula to vba array and dictionary because there are 350000 records and I also use add custom columns in power query so excel formulas don't run automatically so my solution is to use vba.
for information my sheet name is "GSG" and my table name is "GSG_ALL"
Formula in column AD
Formula in column AE
Thanks
roykana
I want to change the formula to vba array and dictionary because there are 350000 records and I also use add custom columns in power query so excel formulas don't run automatically so my solution is to use vba.
for information my sheet name is "GSG" and my table name is "GSG_ALL"
Formula in column AD
Excel Formula:
=IF(AA2="SALES",IF(M2<=25000,M2+V2,0),"")
Excel Formula:
=IF(M2+P2+V2=0,"",IF(AA2="STOCK OPNAME","",IF(AA2="CHANGE ART","",IF(AA2="ITEM TRANSFER","",ROUND(IF(AA2="SALES",(M2+V2-AD2)/P2*100),1)))))
WANT TO CHANGE FORMULA TO VBA ARRAY & DICTIONARY.xlsm | |||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z | AA | AB | AC | AD | AE | |||
1 | CSB | GDN | PNM | DTS | DUD | SAC | OBY | ABY | DSC | PIN | PNP | PON | DIS | POS | SLS | BLC | PKP | PDO | PIV | CDD | RCV | DIS2 | DEPT | OPT | TOTAL | NAME | GROUP DATA | REF CAMUS | CUSTOMER NAME | CASHDISCOUNT | %dis | ||
2 | FGD | 0001 | TEST12110001 | 01/10/2021 | 01/10/2021 | 10000 | A | 0 | 0 | SONONE | 200000 | TRUE | 1000000 | FALSE | 0 | FALSE | 40000 | BOJ | 0 | 1000000 | A | SALES | STORE | A | 0 | 24.00 | |||||||
3 | FGD | 0001 | TEST12110002 | 02/10/2021 | 02/10/2021 | 10001 | A | 0 | 0 | SONONE | 30000 | TRUE | 200000 | FALSE | 0 | FALSE | 29400 | BOJ | 0 | 200000 | B | SALES | STORE | B | 0 | 29.70 | |||||||
4 | FGD | 0001 | TEST12110003 | 03/10/2021 | 03/10/2021 | 10002 | A | 0 | 0 | SONONE | 45000 | TRUE | 300000 | FALSE | 0 | FALSE | 0 | BOJ | 0 | 300000 | C | SALES | STORE | C | 0 | 15.00 | |||||||
5 | FGD | 0001 | TEST12110004 | 04/10/2021 | 04/10/2021 | 10003 | A | 0 | 0 | SONONE | 35000 | TRUE | 500000 | FALSE | 0 | FALSE | 0 | BOJ | 0 | 500000 | D | SALES | STORE | D | 0 | 7.00 | |||||||
6 | FGD | 0001 | TEST12110005 | 05/10/2021 | 05/10/2021 | 10004 | A | 0 | 0 | SONONE | 25000 | TRUE | 250000 | FALSE | 1 | 0 | FALSE | 0 | BOJ | 0 | 250000 | E | SALES | STORE | E | 25000 | 0.00 | ||||||
7 | FGD | 0001 | TEST12110006 | 05/10/2021 | 05/10/2021 | 10005 | A | 0 | 0 | SONONE | TRUE | 100000 | FALSE | 0 | FALSE | 0 | BOJ | 0 | 100000 | F | ITEM TRANSFER | STORE | F | ||||||||||
8 | FGD | 0001 | TEST12110007 | 05/10/2021 | 05/10/2021 | 10006 | A | 0 | 0 | SONONE | TRUE | 20000 | FALSE | 0 | FALSE | 0 | BOJ | 0 | 20000 | G | STOCK OPNAME | STORE | G | ||||||||||
9 | FGD | 0001 | TEST12110008 | 05/10/2021 | 05/10/2021 | 10007 | A | 0 | 0 | SONONE | TRUE | 20000 | FALSE | 0 | FALSE | 0 | BOJ | 0 | 20000 | H | CHANGE ART | STORE | H | ||||||||||
GSG |
Cell Formulas | ||
---|---|---|
Range | Formula | |
AD2:AD9 | AD2 | =IF(AA2="SALES",IF(M2<=25000,M2+V2,0),"") |
AE2:AE9 | AE2 | =IF(M2+P2+V2=0,"",IF(AA2="STOCK OPNAME","",IF(AA2="CHANGE ART","",IF(AA2="ITEM TRANSFER","",ROUND(IF(AA2="SALES",(M2+V2-AD2)/P2*100),1))))) |
Thanks
roykana