It's also pretty easy to do in Excel, favored tool of "marketing gurus". Find/replace, import, pivot.
asort($data);
$duplicate = function ($val) use (&$data) {
$count = 0;
foreach ($data as $i => $entry)
if ($val == $entry) $count++;
return $count;
};
foreach ($data as $v)
if (($count = $duplicate($v)) > 1) {
printf("%d, Count %d\n", $v, $count);
break;
}
I assume it would be possible to use a sort+callback to return the value as well. .sort(function(a,b){if(a==b){throw a;}return a-b;}); JSON.parse(p.innerHTML.split('\n')[2])I'd consider your mention of Excel to be a hack, as I honestly don't have a clue with it beyond the basics.