• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Countif and substitute

PaulyboyUK

New Member
Hi

I am trying to create an extra field on a file I receive periodically where I have to create account codes which are 4 text characters plus 01. If there are duplicates on 4 characters then next one replaces 01 with 02 and so on.
I have uploaded a file that hopefully makes sense - what I want to achieve is one calculated field that creates the acc code - not having to have any other helper fields is this possible?
 

Attachments

  • ACC CODE.xlsx
    14 KB · Views: 16
Formula A2, then copy and paste:
=IF(D2="", "", UPPER(LEFT(SUBSTITUTE(D2, " ", ""), 4)) & TEXT(COUNTIF(A$1:A1, LEFT(SUBSTITUTE(D2, " ", ""), 4) & "*") + 1, "00"))
 
Back
Top