简体   繁体   中英

Is there a way to output a string from one excel cell to another?

I want to output a string from one cell into another cell. The string will always start with #0, and then there will be 4 to 7 characters following it. For example, for this cell:

UI-ESR25893-TA-03-0022 STEAMPLANT-#0009-R1 - Utility Tie-In Drawings-handled out of DRS - close 

I'd want to output "0009-R1" to the new cell.

You can do this by using below formula where the example text resides in cell A1

=MID(A1,FIND("#0",A1,1)+1,FIND(" ",A1,FIND("#0",A1,1))-FIND("#0",A1,1)-1)

where,

FIND("#0",A1,1) locates position where #0 exists and then we add 1 to it to get rid of #.

FIND(" ",A1,FIND("#0",A1,1)) locates the first space after #0 occurs

FIND(" ",A1,FIND("#0",A1,1))-FIND("#0",A1,1)-1 works out the exact length of the string.

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