Spreadsheet: 843956d1695768649-invoice-number-with-batch-function-book4-6-
Sheet: Sheet1

 |  |  | INVOICE | UNIQUE | BATCH | DUE | DELIVERY | DAY | STATUS | BOX-W | AGG BOXES | NAME | Exoected results
 |  |  | 30003779 | True |  | 2023-10-17 00:00:00 | 2023-10-19 00:00:00 | Thursday |  | 3 | 3 | CUSTOMER 1 | 30003779 | Invoice nr +1 for each row with empty BATCH cell
 |  |  |  | True |  | 2023-10-24 00:00:00 | 2023-10-24 00:00:00 | Tuesday |  | 2 | 6 | CUSTOMER 1 | 30003780 | invoice nr same if [NAME] is "1"
 |  |  |  | True |  | 2023-10-24 00:00:00 | 2023-10-26 00:00:00 | Thursday |  | 3 | 3 | CUSTOMER 1 | 30003781 | New nr/+1 if BATCH  is "10" after a row with BATCH nr "1" and oposite
 |  |  |  | True |  | 2023-10-31 00:00:00 | 2023-10-31 00:00:00 | Tuesday |  | 2 | 2 | CUSTOMER 1 | 30003782 | new [NAME] if BATCH "1" or "10" but different customer - example D44
 |  |  |  | False |  | 2023-10-31 00:00:00 | 2023-11-02 00:00:00 | Thursday | C | 0 | 0 | CUSTOMER 1 | 30003783
 |  |  |  | False | 1 | 2023-10-03 00:00:00 | 2023-10-03 00:00:00 | Tuesday |  | 5 | 5 | CUSTOMER 2 | 30003784
 |  |  |  | False | 1 | 2023-10-03 00:00:00 | 2023-10-05 00:00:00 | Thursday |  | 5 | 5 | CUSTOMER 2 | 30003784
 |  |  |  | False | 1 | 2023-10-10 00:00:00 | 2023-10-10 00:00:00 | Tuesday |  | 5 | 5 | CUSTOMER 2 | 30003784
 |  |  |  | False | 1 | 2023-10-10 00:00:00 | 2023-10-12 00:00:00 | Thursday |  | 5 | 5 | CUSTOMER 2 | 30003784
 |  |  |  | False | 1 | 2023-10-17 00:00:00 | 2023-10-17 00:00:00 | Tuesday |  | 5 | 5 | CUSTOMER 2 | 30003784
 |  |  |  | False | 1 | 2023-10-17 00:00:00 | 2023-10-19 00:00:00 | Thursday |  | 5 | 5 | CUSTOMER 2 | 30003784
 |  |  |  | False | 1 | 2023-10-24 00:00:00 | 2023-10-24 00:00:00 | Tuesday |  | 5 | 5 | CUSTOMER 2 | 30003784
 |  |  |  | False | 1 | 2023-10-24 00:00:00 | 2023-10-26 00:00:00 | Thursday |  | 5 | 5 | CUSTOMER 2 | 30003784
 |  |  |  | True | 1 | 2023-10-31 00:00:00 | 2023-10-31 00:00:00 | Tuesday |  | 5 | 45 | CUSTOMER 2 | 30003784
 |  |  |  | False | 1 | 2023-10-31 00:00:00 | 2023-11-02 00:00:00 | Thursday | C | 0 | 0 | CUSTOMER 2 | 30003784
 |  |  |  | False | 10 | 2023-10-03 00:00:00 | 2023-10-03 00:00:00 | Tuesday |  | 2 | 2 | CUSTOMER 3 | 30003785
 |  |  |  | False | 10 | 2023-10-03 00:00:00 | 2023-10-05 00:00:00 | Thursday |  | 2 | 2 | CUSTOMER 3 | 30003785
 |  |  |  | False | 10 | 2023-10-10 00:00:00 | 2023-10-10 00:00:00 | Tuesday |  | 2 | 2 | CUSTOMER 3 | 30003785
 |  |  |  | False | 10 | 2023-10-10 00:00:00 | 2023-10-12 00:00:00 | Thursday |  | 2 | 2 | CUSTOMER 3 | 30003785
 |  |  |  | False | 10 | 2023-10-17 00:00:00 | 2023-10-17 00:00:00 | Tuesday |  | 2 | 2 | CUSTOMER 3 | 30003785
 |  |  |  | False | 10 | 2023-10-17 00:00:00 | 2023-10-19 00:00:00 | Thursday |  | 2 | 2 | CUSTOMER 3 | 30003785
 |  |  |  | False | 10 | 2023-10-24 00:00:00 | 2023-10-24 00:00:00 | Tuesday |  | 2 | 2 | CUSTOMER 3 | 30003785
 |  |  |  | False | 10 | 2023-10-24 00:00:00 | 2023-10-26 00:00:00 | Thursday |  | 2 | 2 | CUSTOMER 3 | 30003785
 |  |  |  | True | 10 | 2023-10-31 00:00:00 | 2023-10-31 00:00:00 | Tuesday |  | 2 | 18 | CUSTOMER 3 | 30003785
 |  |  |  | False | 10 | 2023-10-31 00:00:00 | 2023-11-02 00:00:00 | Thursday | C | 0 | 0 | CUSTOMER 3 | 30003785
 |  |  |  | True |  | 2023-09-26 00:00:00 | 2023-09-26 00:00:00 | Tuesday |  | 2 | 2 | CUSTOMER 4 | 30003786
 |  |  |  | True |  | 2023-10-03 00:00:00 | 2023-10-03 00:00:00 | Tuesday |  | 2 | 2 | CUSTOMER 4 | 30003787
 |  |  |  | True |  | 2023-10-10 00:00:00 | 2023-10-10 00:00:00 | Tuesday |  | 2 | 2 | CUSTOMER 4 | 30003788
 |  |  |  | True |  | 2023-10-17 00:00:00 | 2023-10-17 00:00:00 | Tuesday |  | 2 | 2 | CUSTOMER 4 | 30003789
 |  |  |  | True |  | 2023-10-24 00:00:00 | 2023-10-24 00:00:00 | Tuesday |  | 2 | 2 | CUSTOMER 4 | 30003790
 |  |  |  | True |  | 2023-10-31 00:00:00 | 2023-10-31 00:00:00 | Tuesday |  | 2 | 2 | CUSTOMER 4 | 30003791
 |  |  |  | False | 1 | 2023-10-03 00:00:00 | 2023-10-05 00:00:00 | Thursday |  | 1 | 1 | CUSTOMER 5 | 30003792
 |  |  |  | False | 1 | 2023-10-10 00:00:00 | 2023-10-12 00:00:00 | Thursday |  | 1 | 1 | CUSTOMER 5 | 30003792
 |  |  |  | False | 1 | 2023-10-17 00:00:00 | 2023-10-19 00:00:00 | Thursday |  | 1 | 1 | CUSTOMER 5 | 30003792
 |  |  |  | False | 1 | 2023-10-24 00:00:00 | 2023-10-26 00:00:00 | Thursday |  | 1 | 1 | CUSTOMER 5 | 30003792
 |  |  |  | True | 1 | 2023-10-31 00:00:00 | 2023-11-02 00:00:00 | Thursday |  | 1 | 5 | CUSTOMER 5 | 30003792
 |  |  |  | False | 1 | 2023-10-03 00:00:00 | 2023-10-05 00:00:00 | Thursday |  | 1 | 1 | CUSTOMER 6 | 30003793
 |  |  |  | False | 1 | 2023-10-10 00:00:00 | 2023-10-12 00:00:00 | Thursday |  | 1 | 1 | CUSTOMER 6 | 30003793
 |  |  |  | False | 1 | 2023-10-17 00:00:00 | 2023-10-19 00:00:00 | Thursday |  | 1 | 1 | CUSTOMER 6 | 30003793
 |  |  |  | False | 1 | 2023-10-24 00:00:00 | 2023-10-26 00:00:00 | Thursday |  | 1 | 1 | CUSTOMER 6 | 30003793
 |  |  |  | True | 1 | 2023-10-31 00:00:00 | 2023-11-02 00:00:00 | Thursday |  | 1 | 5 | CUSTOMER 6 | 30003793