W
W
WebforSelf2021-10-14 17:42:42
excel
WebforSelf, 2021-10-14 17:42:42

How to remove a character at the end of a cell?

BGT-2010c
BGS-2111-
BGS-2111-
BGP-2014B

There are cells of different lengths, and somewhere there is a dash at the end, but somewhere not.
How to remove the dash at the end?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
W
WebforSelf, 2021-10-14
@WebforSelf

=SUBSTITUTE(SUBSTITUTE(A1&"|";"-|";);"|";)
Optional

A
Alexander, 2021-10-14
@ForestAndGarden

If the cell is non-empty then compress spaces, then if a single right character equals a hyphen then return left characters by a number equal to the length of the cell minus one, else return the value of the cell.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question