Hello! I am hoping somebody can help me with this problem. Thank you in advance for your help!
I am looking for a formula (prefer not to use VBA) that will accomplish the following, with the formula/results in column B.
When the first 5 characters of a cell are repeated within that same cell, I would like for all text/characters that are after that second occurrence of those first 5 characters, including those 5 characters itself, to be cleared/removed. If there is no second occurrence of those first 5 characters, then nothing needs to be cleared/removed. Here are some examples...
Hopefully I've explained that clearly enough. Thank you for your help!
-Mark
I am looking for a formula (prefer not to use VBA) that will accomplish the following, with the formula/results in column B.
When the first 5 characters of a cell are repeated within that same cell, I would like for all text/characters that are after that second occurrence of those first 5 characters, including those 5 characters itself, to be cleared/removed. If there is no second occurrence of those first 5 characters, then nothing needs to be cleared/removed. Here are some examples...
Current cell (A1): | (pizza 345) bananas are yellow (pizza 345) grass is green sky is blue |
Desired result (B1): | (pizza 345) bananas are yellow |
Note: | "(pizz" are the first 5 characters, so everything after second occurrence of "(pizz", including itself, is removed. |
Current cell (A2): | (1 pizza 345) bananas are yellow (1 pizza 345) grass is green sky is blue |
Desired result (B2): | (1 pizza 345) bananas are yellow |
Note: | "(1 pi" are the first 5 characters, so everything after second occurrence of "(1 pi", including itself, is removed. |
Current cell (A3): | (pizza 345) bananas (p) are yellow (pizza 345) grass is green sky is blue |
Desired result (B3): | (pizza 345) bananas (p) are yellow |
Note: | "(pizz" are the first 5 characters, so everything after second occurrence of "(pizz", including itself, is removed. |
Current cell (A4): | (pizza 345) bananas (pizz are yellow (pizza 345) grass is green (p) sky is blue |
Desired result (B4): | (pizza 345) bananas |
Note: | "(pizz" are the first 5 characters, so everything after second occurrence of "(pizz", including itself, is removed. |
Current cell (A5): | (pizza 345) bananas are yellow grass is green (p) sky is blue |
Desired result (B5): | (pizza 345) bananas are yellow grass is green (p) sky is blue |
Note: | "(pizz" not repeated in the cell, so nothing cleared/removed. |
Hopefully I've explained that clearly enough. Thank you for your help!
-Mark