View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Phil Delaney Phil Delaney is offline
external usenet poster
 
Posts: 3
Default google sheets truncate #characters but full words

Hi,

Hoping some clever people can help out here!

I have a list of sentences, which I need to place in another doc. This other doc can take up to 3 lines of separate text with each line having a set max number of characters.

Is there a way to take the original full sentence and split this over the 1, 2 or 3 lines based on the number of characters which are limited to each line, but only take full words?

For example, one sentence might be:
Ideally the text result should look something like this each line

If the first line in the doc can take a max character limit of 21.
21 characters is:
Ideally the text resu
However, I only want the result to be the full words from that result, so:
Ideally the text

I then want the second line to lead from that. If this second line in the doc can take a max character limit of 15.
The next 15 characters after the previous full word, is (ignoring the start and end spaces):
result should look someth
Again, I only want the result to be the full words from that result, so:
result should look

And the same for the thrid line. If this limit were 18, the letters following on from the previous would be:
something like this each lin
Full words mean the result would need to be:
something like this each

So the final text back would be:

1st line: Ideally the text
2nd line: result should look
3rd line: something like this each

However, if there is a sentence with only 18 chars, we still want the words back. Same goes for sentences that would fulfil 2 lines (21 and 15).



Any help would be greatly appreciated.

Thanks,!