Extract text from cell of with numbers

FryGirl

Well-known Member
Joined
Nov 11, 2008
Messages
1,362
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
I have this working part way, but of course, not complete. The original is in column A and I would like the results of column B. Column C shows the formula I tried.

bibles.xlsm
ABC
1Colossians 4:18ColossiansColossians
21 Thessalonians 1:11 Thessalonians 
Sheet4
Cell Formulas
RangeFormula
C1:C2C1=LEFT(A1,MIN(SEARCH({0,1,2,3,4,5,6,7,8,9},A1&"0123456789"))-1)
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
but B column contain number also
Extract text from cell of with numbers

so maybe:
sourcetext
Colossians 4:18Colossians
1 Thessalonians 1:1Thessalonians
 
Last edited:
Upvote 0
Yes, but I should have said, separate at the number just before the colon.
 
Upvote 0
Does this do what you want...

=TRIM(LEFT(A1,LEN(A1)-LEN(TRIM(RIGHT(SUBSTITUTE(A1," ",REPT(" ",99)),99)))))
 
Upvote 0
Solution
sourcesource
Colossians 4:18Colossians
1 Thessalonians 1:11 Thessalonians
1232 Thessalonians 1:11232 Thessalonians
3 Thessalonians 341:13 Thessalonians

Power Query:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    ETBD = Table.TransformColumns(Source, {{"source", each Text.BeforeDelimiter(_, " ", {0, RelativePosition.FromEnd}), type text}})
in
    ETBD
 
Upvote 0
Thanks Rick. That sure does work. I also played around and came up with

=LEFT(A1,FIND("|",SUBSTITUTE(A1," ","|",LEN(A1)-LEN(SUBSTITUTE(A1," ",""))))-1)
 
Upvote 0
Thanks Rick. That sure does work. I also played around and came up with

=LEFT(A1,FIND("|",SUBSTITUTE(A1," ","|",LEN(A1)-LEN(SUBSTITUTE(A1," ",""))))-1)
If you do not mind array-entered** formulas, this one will also work...

=LEFT(A1,MAX(IF(MID(A1,ROW($1:$99),1)=" ",ROW($1:$99)))-1)

**Commit this formula using CTRL+SHIFT+ENTER and not just Enter by itself

NOTE: This formula assumes no chapter name is longer than 99 characters which I believe to be true.
 
Upvote 0

Forum statistics

Threads
1,214,522
Messages
6,120,022
Members
448,939
Latest member
Leon Leenders

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top