if you are happy with varchar daat type instead of text datatype then i can provide you the solution. it can be done by auto computing formula. it will automatically count and give you the required result and automaticall it will take your column as varchar datatype by default.
if you are fine with varchar datatype, let me know. i will provide you the solution.
Thanks