Extract a fixed number of characters from a cell but just full words -Formula needed

samst

Board Regular
Joined
Feb 12, 2003
Messages
70
I looked for an answer to this but didn't find what I was looking for.

I need to extract up to the first 100 characters in a cell but only up to the last full word. So if the 101th character is in the middle of a word it shouldn't extract any of that word or anything after it.

I've been trying to mess around with this formula but haven't gotten it to work right

=TRIM(LEFT(SUBSTITUTE(A1," ",REPT(" ",50)),100))

Any help would be awesome

Thanks
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.

ukmikeb

Well-known Member
Joined
Jul 10, 2009
Messages
2,757
Hi

Try :-
Code:
=LEFT(A1,FIND("##",SUBSTITUTE(A1," ","##",101-LEN(SUBSTITUTE(LEFT(A1,101)," ",""))))-1)

hth
 
Upvote 0

Rick Rothstein

MrExcel MVP
Joined
Apr 18, 2011
Messages
38,154
Office Version
  1. 2019
  2. 2010
Platform
  1. Windows
Give this array-entered** formula a try...

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

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

Forum statistics

Threads
1,196,021
Messages
6,012,906
Members
441,740
Latest member
Latrs

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
Top