How can I design the formula ID by my own?

I want to create the formula for my id by automatically, how do I write the formula for it? As I wish to separate ID for each type of our product.

For example I have 5 kind s of product and I want toe generate ID separate each one
First : Furniture start with FT-001
Second : Cloth start with CL-001
… etc

So how can I write the formula instead of UNIQUE()?