modify text splitting function to work with rows instead of columns

  • I am trying to modify krishna kumar's function (found here: http://www.ozgrid.com/forum/sh…=If+SplitCount+Len%28v%29) to work with rows instead of columns. I have copied the code from his post below. As per his post it is accessed by using the formula =XTRACT40($B3,COLUMNS($C3:C3))

    I have tried changing it to =XTRACT40(B$3,ROW(C$3:C3)) and =XTRACT40(B$3,ROWS(C$3:C3)) (array) and several other variations with no success.

    To quickly summarize what krishna kumar's code is doing; it splits up long sentences/text strings contained in a single cell and spreads them over multiple cells to the right of the cell with the long sentence/text string. In the example below any sentence/text string over 40 chars is broken up into max 40 character segments per cell.


    For example, if you had "The quick brown fox leaped over the restless dog" in cell B3 and copied that formula into cells C3 and D3 you would end up with "The quick brown fox leaped over the" in cell C3 and "restless dog" in D3, even though ""The quick brown fox leaped over the" is only 35 chars long. This is because krisha kumar's code is also smart enough not to break up words, in this case 'restless' where the 't' is the 40th character.


    My goal is to be able to use this function by coping the formula into the cells beneath the target cell instead of beside them. Any assistance is greatly appreciated.



  • Re: modify text splitting function to work with rows instead of columns


    Different method


    =SplitSentence(B$3,40,ROWS($1:1))


    And filldown.


Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!