How to add auto incremental number in formula

How to add auto incremental number in formula

Hi there,

I don't know if this is possible but here it goes: I need to create a custom field for Deals so every time a Deal is created it has its own unique code, which is made of the first three characters of the Account name + an auto incremental number. Let's say the Account name is John Doe, the first Deal to be created would have the code JOH0001, the if another deal using the same account number is created, its code would be JOH0002, and so on. If another deal is created but form another account, let's say its named Homer Simpson, the code would be HOM0001, etc . The thing is that I don't know how to resolve the auto incremental number.

Any ideas?

Thanks!