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, destination, etc are provided. My challenge is on the box numbering. Please have a look at the attached file.

After getting the data, I add the boxes range/numbering. I want to skip counting the boxes that are repeated.


2 Replies


If the duplicate box #'s are always right next to each other, this should work for your purposes.


 Just checks if the above box # is the same as the current one and if so, ignores it. Otherwise uses your same formula.

@DKoontz A variant that tries to accommodate non-adjacent and overlapping possibilities:


This starts in the 2nd data row.  I changed a few box numbers to really test it in the attached.