简体   繁体   中英

Excel formula to extract text from mixed column

I have a column of mixed data which needs to be split into 2 columns in order to separate the text from the dates:

之前

This is how the data should look when split:

在此处输入图片说明

I could do this using a VBA solution, but I was wondering if there is a sheet level formula (in col A) which would accomplish this instead.

I was able to accomplish this using various formulas over multiple(!) columns, but that process required a tremendous(!) amount of concatenation and cleanup. Maybe I am overthinking this and missing how to make a more straightforward solution (or maybe I am simply unfamiliar with how to properly reach such a solution), but I would love to learn how to approach this issue using a more elegant and straightforward process (if possible).

In A1 put "Horse"

In A2 put the following formula:

=IF(B2="","",IF(B1="",B2,A1))

And copy down.

Formula in A1:

=B1

Formula in A2 (fill down):

=IF(B2="","",IF(ISNUMBER(B2),A1,B2))

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM