This formula checks whether a Singaporean National Registration Identity Card (NRIC) number is valid by verifying its checksum digit.
The formula takes the NRIC number as input in cell B3. It first checks that the NRIC number has a length of 9 using the LEN() function.
If the NRIC number is 9 characters long, the formula then calculates the checksum using the following steps:
Extracts the first letter of the NRIC number using the LEFT() function, and converts it to uppercase using the UPPER() function.
Looks up the corresponding conversion table for the first letter of the NRIC number in the array
{"S","J","Z","I","H","G","F","E","D","C","B","A";"T","J","Z","I","H","G","F","E","D","C","B","A";"F","X","W","U","T","R","Q","P","N","M","L","K";"G","X","W","U","T","R","Q","P","N","M","L","K";"M","Y","X","W","U","T","R","Q","P","N","M","L"} using the VLOOKUP() function.
Looks up the corresponding conversion value for the first letter of the NRIC number in the array {"S",0;"T",4;"F",0;"G",4;"M",9;"A",1;"B",2;"C",3;"D",4;"E",5;"H",6;"I",7;"J",8;"K",9} using the VLOOKUP() function.
Multiplies each digit of the NRIC number except the first and last digits with a corresponding weight from the array {2,7,6,5,4,3,2}.
Sums up the products obtained in step 4.
Adds the result obtained in step 5 to the conversion value obtained in step 3, and takes the modulo 11.
Adds 2 to the result obtained in step 6, and takes the modulo 10.
Looks up the final conversion value in the array {"J","Z","I","H","G","F","E","D","C","B","A"} using the VLOOKUP() function.
The formula then checks whether the final conversion value obtained in step 8 is equal to the last digit of the NRIC number using the RIGHT() function. If they are equal, the formula returns TRUE, indicating that the NRIC number is valid. Otherwise, the formula returns FALSE, indicating that the NRIC number is invalid.
This is the original code that work from for the 4 first Starting NRIC / FIN : S, F, T, G
Bookmarks