Reputation: 1728
I have a excel column called as Add_type which has type of address
Add_type
route
Sub-locality
locality
administrative_area_level_1
country
postal_code
premise
Sub-locality
Sub-locality
administrative_area_level_1
country
Sub-locality
Sub-locality
Sub-locality
So What I expect is if there is occurrence of word " Sub-locality" consecutively then second occurrence should be replaced by Sub-locality1 AND if there are three consecutive occurrences of " Sub-locality" the second should be replaced by "Sub-locality1" and third by "Sub-locality2"
I tried with =IF(A8=A9,"Sub-locality1",A8)
but this doesn't solve the problem
Such that my output would look like
route
Sub-locality
locality
administrative_area_level_1
country
postal_code
premise
Sub-locality
Sub-locality1
administrative_area_level_1
country
Sub-locality
Sub-locality1
Sub-locality2
Any suggestion on how this should be done. Any help would be much appreciated. Thanks.
Upvotes: 0
Views: 27
Reputation: 3573
This one should work as long as there is no more than 10 repetitions.
=IF(A8=A9,A9 & IF(A8=B8,1,RIGHT(B8)+1),A8)
Insert this in B9.
Upvotes: 1