Yes, there is a simpler way to achieve this without subtracting the last 5 characters. You can use the LEFT function to extract the first three characters from cell A1 and then concatenate it with a hyphen and the first three words from cell B1. Here's how you can do it:
- In cell C1, type the following formula:
Formula:
=LEFT(A1,3)&"-"&LEFT(B1,FIND(" ",B1)-1)
- Press Enter to apply the formula.
The
LEFT function extracts the first three characters from cell A1 and the
FIND function finds the position of the first space in cell B1. The
LEFT function then extracts the characters from the beginning of cell B1 up to the position of the first space minus one (to exclude the space). Finally, the two results are concatenated with a hyphen using the ampersand (&) operator.
This formula should give you the desired result of
"ABC1-XYZ" in cell C1.