tags:

views:

45

answers:

1

In Excel, how do I write a formula that will partially delete a cell (from a certain point onwards).

For example, if A1 is "23432 Vol 23432". I want B1 to just be "23432 " (everything from Vol onwards is removed). Thanks.

+2  A: 

you cannot delete cells with formulas in Excel.

you can modify the content of a cell by using formulas. you may use LEFT(), RIGHT(), MID() and other similar string processing functions.

is there any rule about the number? If for example the number is always 5 digits long, you can return "23432" out of "23432 Vol 23432" by typing =LEFT(A1;5)

you might also want to look for the space. think the english equivalent for the german FINDEN-function is FIND(keyword;text;[first charindex]). if splitting by space, you find the number by =LEFT(A1;FIND(" ";A1))

please post detailed information about your problem if you need further assistance.

EDIT: you may also use VBA if your problem needs a custom formula or custom actions taken out on a cell.

EDIT2, SOLUTION:

=LEFT(A1;FIND(" Vol";A1))

is the solution to your problem, iff "Vol" and the rest needs to be removed in any case without condition. Remember that if you have any condition attached to this, you might nest this expression (without the '=' though) in a "IF()"-formula.

hope that helped you.

best regards

Atmocreations
Quite specifically I need to remove everything from "Vol" onwards (including "Vol"). So I guess some sort of substring function that returns the index, and then doing a LEFT on it.
jonty