Skip to content

Instantly share code, notes, and snippets.

@wonglkd
Last active June 13, 2020 11:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wonglkd/72f4f961932d147ff71b7bc509004bd3 to your computer and use it in GitHub Desktop.
Save wonglkd/72f4f961932d147ff71b7bc509004bd3 to your computer and use it in GitHub Desktop.
NRIC checksum letter calculator for Excel
=MID(
IF(OR(LEFT(C2,1)="S", LEFT(C2,1)="T"),
"JZIHGFEDCBA",
"XWUTRQPNMLK"),
MOD(
MID(C2,2,1)*2+
MID(C2,3,1)*7+
MID(C2,4,1)*6+
MID(C2,5,1)*5+
MID(C2,6,1)*4+
MID(C2,7,1)*3+
MID(C2,8,1)*2+
IF(OR(LEFT(C2,1)="G", LEFT(C2,1)="T"),4,0),
11)+1,
1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment