# Replace a value with different name

#### vinoth.s1

##### New Member
I have attached the sample work book in this. In this I need for an employee if L is updated ie. leave is updated it need to be changed to PL1. If the same employee took 5 days leave it need to be updated from PL1 to PL5. After that if the employee takes leave it need to be changed to CL1,CL2....so on.

#### Attachments

• 14.4 KB Views: 8

#### vletm

##### Excel Ninja
vinoth.s1
This ... while try to open Your file ...

#### vletm

##### Excel Ninja
vinoth.s1
Seems that You have already forget some basic rules.

#### vinoth.s1

##### New Member
I have attached the work book which is opening now. Yes i have done in other forum before coming here. I have read the site rules now which i understood. If i come to know the answer will post here so that others can also be benefited.

Thanks for your time and making me understand

#### Attachments

• 9.6 KB Views: 4

#### vletm

##### Excel Ninja
vinoth.s1
Those and any other rules should read ... before ... start to do something.

#### vinoth.s1

##### New Member
yes you are right i have read the rules
thanks again

#### S. Das

##### Active Member
vinoth.s1
Please find this is working or not.

#### Attachments

• 11.5 KB Views: 3

#### bosco_yip

##### Excel Ninja
vinoth.s1
Please find this is working or not.
Hi S. Das,

Here's my formula solution using IF+COUNTIF function only.

In D12, formula copied across and down :

=IF(D6<>"L",D6,IF(COUNTIF(\$D6:D6,"L")<6,"PL"&COUNTIF(\$D6:D6,"L"),"CL"&COUNTIF(\$D6:D6,"L")-5))

Last edited:

#### S. Das

##### Active Member
Thanks bosco_yip. I missed this point. You are awesome as always.
But still, there is a drawback in my formula as well as your formula. Both formulas working without checking the employee name, just referring to the cell. How could this drawback be overcome?