tommybone30
New Member
- Joined
- Dec 14, 2017
- Messages
- 14
I need to find the best solution for this Excel problem.
I've done a formula where a cell will populate anything to the left of the first hyphen in the adjacent cell. This is essentially a 2500 cells project, but for simplicity sake I'll only use about 5 cells out of 2500.
For example:
Cell A1:
Sales 3220-General-Remote-COI-Support
Cell A2:
Sales & Marketing-General-Woodland Hills-ACT-Admin
With the formula "=LEFT(A1,FIND("-",A1)-1)" and "=LEFT(A2,FIND("-",A2)-1)" in cells B1 and B2, this will populate:
Cell B1:
Sales 3220
Cell B2:
Sale & Marketing
In this Excel sheet, 99.6% of the cells used the above formula, which works great. However, there are a few cells where I need to include data in between the first and second hyphen, instead of before the first hyphen. For example:
Cell A3:
Sales-1st Party 3221-General-Atlanta-COI-Support
Cell A4:
Sales-3rd Party 3223-General-Atlanta-COI-Support
Cell A5:
Sales-3rd Party 3223-General-Remote-COI-Support
I'm looking for a formula where if these cells do not contain any texts in cells A3, A4, and A5, it would display any cell data similar to B1 and B2, but if it does contain cells A3, A4, A5, it would display the following:
Cell B3:
Sales-1st Party 3221
Cell B4:
Sales-3rd Party 3223
Cell B5:
Sales-3rd Party 3223
Please help me out! Let me know if this question isn't clear.
I've done a formula where a cell will populate anything to the left of the first hyphen in the adjacent cell. This is essentially a 2500 cells project, but for simplicity sake I'll only use about 5 cells out of 2500.
For example:
Cell A1:
Sales 3220-General-Remote-COI-Support
Cell A2:
Sales & Marketing-General-Woodland Hills-ACT-Admin
With the formula "=LEFT(A1,FIND("-",A1)-1)" and "=LEFT(A2,FIND("-",A2)-1)" in cells B1 and B2, this will populate:
Cell B1:
Sales 3220
Cell B2:
Sale & Marketing
In this Excel sheet, 99.6% of the cells used the above formula, which works great. However, there are a few cells where I need to include data in between the first and second hyphen, instead of before the first hyphen. For example:
Cell A3:
Sales-1st Party 3221-General-Atlanta-COI-Support
Cell A4:
Sales-3rd Party 3223-General-Atlanta-COI-Support
Cell A5:
Sales-3rd Party 3223-General-Remote-COI-Support
I'm looking for a formula where if these cells do not contain any texts in cells A3, A4, and A5, it would display any cell data similar to B1 and B2, but if it does contain cells A3, A4, A5, it would display the following:
Cell B3:
Sales-1st Party 3221
Cell B4:
Sales-3rd Party 3223
Cell B5:
Sales-3rd Party 3223
Please help me out! Let me know if this question isn't clear.