Forum Discussion
A_SIRAT
Nov 19, 2021Iron Contributor
Counting items and box numbering
Hi Guys, I would like to easily create an Invoice and Packing List using MS excel from Data extracted from a system. All the required headers needed from Consignor to Consignee, order nr, destinatio...
DKoontz
Nov 19, 2021Iron Contributor
If the duplicate box #'s are always right next to each other, this should work for your purposes.
=IF(F3=F2,"",F3-E3+1)Just checks if the above box # is the same as the current one and if so, ignores it. Otherwise uses your same formula.
mtarler
Nov 19, 2021Silver Contributor
DKoontz A variant that tries to accommodate non-adjacent and overlapping possibilities:
=MAX(0,MIN(IF((F4>=E$2:E3)*(F4<=F$3:F3),E$3:E3-1,F4))-MAX(IF((E4>=E$3:E3)*(E4<=F$3:F3),F$3:F3+1,E4))+1)-SUMIFS(I$3:I3,E$3:E3,">"&E4,F$3:F3,"<"&F4)This starts in the 2nd data row. I changed a few box numbers to really test it in the attached.