title: What Excel formula can I use to combine duplicate entries with both unique data and overlapping data into a single line item?
body: <p>I have a large dataset of shipment tracking numbers and costs associated with transportation, surcharges, and duties &amp; taxes. The majority of the tracking numbers are unique, but a meaningful minority are duplicates. Many of the duplicates introduce new information, i.e. the first entry contains costs associated with transportation and associated surcharges, whereas the second entry contains costs associated with duties &amp; taxes, which are mutually exclusive costs from the transportation and surcharges. There are, however, a smaller minority of duplicate tracking numbers that contain new costs associated with the same surcharges included in the original entry. When a duplicate tracking number introduces new cost categories and amounts, I need to combine the new information on the duplicate tracking number by adding the surcharge category and associated cost to the right of the existing information in a single line item. When a duplicate tracking number has a categorical charge overlap with the original, I need to add the costs associated with the duplicate surcharge across the duplicate tracking numbers into a single cell. In many cases, duplicate tracking introduce both new categories of surcharges and associated costs and overlapping categorical surcharges that need to be summed together across original and duplicate tracking.</p>
  
  <p>I have tried a combination of nested VLOOKUP, INDEX, and ADDRESS functions to no avail.</p>
  
  <p>Example - 3 duplicate entries:</p>
  
  <p><a href="https://i.stack.imgur.com/RQ9kZ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/RQ9kZ.png" alt="enter image description here"></a></p>
  
  <p>Desired result:</p>
  
  <p><a href="https://i.stack.imgur.com/tEQXu.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/tEQXu.png" alt="enter image description here"></a></p>