 <p>You're almost there, push the whole array when its not yet set on the new container, if already set, then just add them:</p> <pre><code>$newArr = []; foreach($array as $value) { if(!isset($newArr[$value['NAME']])) { // if this name is not yet inside, push it $newArr[$value['NAME']] = $value; } else { // if already inside then add $newArr[$value['NAME']]['USED_LICENSES'] += $value['USED_LICENSES']; $newArr[$value['NAME']]['TOTAL_LICENSES'] += $value['TOTAL_LICENSES']; $newArr[$value['NAME']]['DENIED_LICENSES'] += $value['DENIED_LICENSES']; } } // $newArr = array_values($newArr); // optional array reindex </code></pre>