Hi,
could you please advise on below question-any help or suggestion I will grately appreciate

I have a list of two information: company name and a sale number. Moreover for each company and one sale number I have a pattern of refernce number.

Example

Lets say AAAcompany and sale number 26. For this particular case I know that reference number is AAAc260MMX.

I need to create reference numbers for diffrent sale numbers- for instance
AAAcompany sale number 32 : I should receive reference number AAAc320MMX
AAAcompany sale number 54,3 I should receive reference number AAAc543MMX

and so on.

Why it is so hard for me;
+there are many examples like:
BBBcompany sale number 23.5 : reference number: BB0002350L3
refrence number for BBBcompany and sale number 32 should be BB0003200L3

My question: could you give me any hint how to do it without any mistakes?
I have tried to cut reference number in 3 pieces (because only numbers in the middle change) but I stuck here...