In reply to C Paxton.

Glad it helped you -- and thanks for sharing your revision! BUT, I ran your version and found some different results. In my small test data, my version reports records 3 and 4 as valid NPIs (1013955343 and
1134108814), but your version of the function reports them as invalid.