Unique Keyword List Error

maddog9486

New Member
Joined
Mar 13, 2015
Messages
9
Office Version
  1. 365
Platform
  1. Windows
I have a data set of 954 questions that i am attempting to generate a unique list of keywords from. I am using the following code to generate a partial list, but I cannot extend past row 124 (i get a #CALC! error if i change 124 to any higher value). I suspect this is due to the character limit of TEXTJOIN. Is there a better way to do this to overcome the limit? I would prefer to avoid macros if possible, but if that is the only option, that will be ok.

Excel Formula:
=UNIQUE(FILTERXML("<t><s>"&TEXTJOIN("</s><s>",,SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(FAQ!C5:C124,", ","</s><s>"),"?","</s><s>"),CHAR(146),"</s><s>"),":","</s><s>"),".","</s><s>"),"""","</s><s>"),"(","</s><s>"),")","</s><s>"),"'","</s><s>"),CHAR(10),"</s><s>")," ","</s><s>"),"</s><s></s><s></s><s>","</s><s>"),"</s><s></s><s>","</s><s>"))&"</s></t>","//s"))
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
What version of Excel are you using?

I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)
 
Upvote 0
What version of Excel are you using?

I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)
Thanks for the suggestion. It's been a while since i've been on the forum. I was not aware that was an option. I've updated it now.
 
Upvote 0
Thanks for that.
Can you get all the rows using, that way they can be split later.
Excel Formula:
=TEXTJOIN(",",,FAQ!C5:C124)
 
Upvote 0
No, the furthest row I can get to with just a straight TEXTJOIN is 216 (my current questions set goes to 954, but could expand). I did check the number of characters within all the cells and it totals 140,389, hence where i believe i am facing the TEXTJOIN issue.

As soon as I figure out how to attach a file, I can share the sample workbook.
 
Upvote 0
You cannot attach files here, you would need to upload it to a share site such as OneDrive, GoogleDrive, DropBox. Then mark for sharing & post the link you are given.
 
Upvote 0
Here is a sample file. The Questions in Column A and my attempt at a unique keyword list in column D. I can only select the range A2:A121 in the keyword formula. Anything above that nets a the #CALC! error.

Sample.xlsx
 
Upvote 0
Thanks for that. How about
Excel Formula:
=UNIQUE(DROP(REDUCE("",A2:A951,LAMBDA(x,y,VSTACK(x,TOCOL(TEXTSPLIT(y,CHAR(10),{","," ","?","'",":","(",")",".","""","’"},1),3)))),1))
although it might be a bit slow depending on your computer.
 
Upvote 0
Solution
Thanks for that. How about
Excel Formula:
=UNIQUE(DROP(REDUCE("",A2:A951,LAMBDA(x,y,VSTACK(x,TOCOL(TEXTSPLIT(y,CHAR(10),{","," ","?","'",":","(",")",".","""","’"},1),3)))),1))
although it might be a bit slow depending on your computer.
You sir are a genius. This appears to work perfectly. Only took 2-3 seconds to run for me. This is above my knowledge base so I need to do some homework to understand the inner workings of this. Thank you @Fluff.
 
Upvote 0
Glad to help & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,215,219
Messages
6,123,688
Members
449,117
Latest member
Aaagu

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