May 2021 2 43 Report
Trimming dashes in Excel?

How do I get excel to output the following in the second column?

This is the equation I was given but it doesn't work when there is text inside the number.

=VALUE(IF(ISNUMBER(FIND("-",A1)), REPLACE(A1, FIND("-", A1), LEN(A1)-1+FIND("-", A1), ""),A1))

123ab4567 becomes 123ab4567

123ab4567-1 becomes 123ab4567

a1234567 becomes a1234567

a1234567-1 becomes a1234567

12345678-1 becomes 12345678

12345678-001 becomes 12345678

12345678-01 becomes 12345678

12345678-ab becomes 12345678

Thanks

PS without the word "becomes" lol


Please enter comments
Please enter your name.
Please enter the correct email address.
You must agree before submitting.

Answers & Comments




Helpful Social

Copyright © 2024 Q2A.MX - All rights reserved.