Text to rows formula only able to separate 66 values

Gavinmk

New Member
Joined
Jan 6, 2016
Messages
13
For some reason, if I include more than 66 of the below countries, it says #VALUE! in all of the cells that have the formula I'm trying to use.


I am trying to use this formula: =TRIM(MID(SUBSTITUTE(E$2,";",REPT(" ",500)),ROW(A1)*500-499,500))


I am trying to enter in this as the input:
Albania; Algeria; Angola; Argentina; Armenia; Australia; Austria; Azerbaijan; Bahamas; Bahrain; Bangladesh; Barbados; Belarus; Belgium; Belize; Bermuda; Bolivia; Bosnia & Herzegovina; Brazil; Brunei; Bulgaria; Cameroon; Canada; Cape Verde; Cayman Islands; Chile; Colombia; Costa Rica; Côte d'Ivoire; Croatia; Curacao; Cyprus; Czech Republic; Denmark; Dominican Republic; Ecuador; Egypt; El Salvador; Estonia; Faroe Islands; Fiji; Finland; France; Georgia; Germany; Ghana; Greece; Guatemala; Honduras; Hong Kong; Hungary; Iceland; India; Indonesia; Iraq; Ireland; Israel; Italy; Jamaica; Japan; Jordan; Kazakhstan; Kenya; Korea; Kuwait; Kyrgyzstan; Latvia; Lebanon; Libya; Liechtenstein; Lithuania; Luxembourg; Macau SAR; Macedonia; Malaysia; Malta; Mauritius; Mexico; Moldova; Monaco; Mongolia; Montenegro; Morocco; Netherlands; New Zealand; Nicaragua; Nigeria; Norway; Oman; Pakistan; Palestinian Territories; Panama; Paraguay; Peru; Philippines; Poland; Portugal; Puerto Rico; Qatar; Romania; Russia; Rwanda; Saudi Arabia; Senegal; Serbia; Singapore; Slovakia; Slovenia; South Africa; Spain; Sri Lanka; St. Kitts and Nevis; Sweden; Switzerland; Taiwan; Thailand; Trinidad & Tobago; Tunisia; Turkey; Turkmenistan; U.S. Virgin Islands; Ukraine; United Arab Emirates; United Kingdom; United States; Uruguay; Uzbekistan; Venezuela; Vietnam; Zimbabwe




Here's the workbook I'm using: country name verifier.xlsx - Speedy Share - upload your files here
 

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.
I can get it to 81 names (up to Mongolia), using this...
=TRIM(MID(SUBSTITUTE($A$8,";",REPT(" ",LEN($A$8))),LEN($A$8)*(ROW()-$F$1)+1,LEN($A$8)))

(your formula seems to pill in a random I word between Iran and Ireland)
 
Upvote 0
Gavinmk,

I have encountered this before. There is a character limit that all those spaces can exceed. I got #VALUE! errors when I did that, too. Also when parsing such a long string there is a tendency to "chop" the words like I suspect Ford encountered.

What is the end goal? Are you trying to separate these countries into different cells or are you trying to put them into an array? Other?

I'll try to find how this finally got resolved. The solution might apply. Can you tell us more?

Dave

Edit Never mind. The title tells me. Duh. LOL
 
Last edited:
Upvote 0
Gavinmk,

I found that old file.

This uses two helper cells to reduce calculations in the last formula.

With the original string in A2 this helper formula in B2
Code:
=";"&SUBSTITUTE($A$2,"; ",";")
Then in C2
Code:
=LEN($B$2)

Then this array entered formula in D2 filled down until you get blanks.
Code:
=IFERROR(TRIM(LEFT(SUBSTITUTE(MID($B$2,SMALL(IF(MID($B$2,ROW(INDIRECT("1:"&$C$2)),1)=";",ROW(INDIRECT("1:"&$C$2))+1),ROWS($2:2)),50),";",REPT(" ",50),1),50)),"")
If you aren’t familiar with array-entered formulas array enter means the formula must be committed from edit mode by simultaneously pressing and holding down Ctrl and Shift while hitting Enter.

Here is the first few rows of what it does. I did not include A2 or B2 below. The strings are too long.

[Table="width:, class:grid"][tr][td]Row\Col[/td][td]
C​
[/td][td]
D​
[/td][/tr][tr][td]
1​
[/td][td]Helper Len[/td][td][/td][/tr]
[tr][td]
2​
[/td][td]
1219​
[/td][td]Albania[/td][/tr]
[tr][td]
3​
[/td][td][/td][td]Algeria[/td][/tr]
[tr][td]
4​
[/td][td][/td][td]Angola[/td][/tr]
[tr][td]
5​
[/td][td][/td][td]Argentina[/td][/tr]
[tr][td]
6​
[/td][td][/td][td]Armenia[/td][/tr]
[tr][td]
7​
[/td][td][/td][td]Australia[/td][/tr]
[tr][td]
8​
[/td][td][/td][td]Austria[/td][/tr]
[tr][td]
9​
[/td][td][/td][td]Azerbaijan[/td][/tr]
[tr][td]
10​
[/td][td][/td][td]Bahamas[/td][/tr]
[tr][td]
11​
[/td][td][/td][td]Bahrain[/td][/tr]
[tr][td]
12​
[/td][td][/td][td]Bangladesh[/td][/tr]
[tr][td]
13​
[/td][td][/td][td]Barbados[/td][/tr]
[tr][td]
14​
[/td][td][/td][td]Belarus[/td][/tr]
[tr][td]
15​
[/td][td][/td][td]Belgium[/td][/tr]
[tr][td]
16​
[/td][td][/td][td]Belize[/td][/tr]
[tr][td]
17​
[/td][td][/td][td]Bermuda[/td][/tr]
[tr][td]
18​
[/td][td][/td][td]Bolivia[/td][/tr]
[tr][td]
19​
[/td][td][/td][td]Bosnia & Herzegovina[/td][/tr]
[tr][td]
20​
[/td][td][/td][td]Brazil[/td][/tr]
[tr][td]
21​
[/td][td][/td][td]Brunei[/td][/tr]
[tr][td]
22​
[/td][td][/td][td]Bulgaria[/td][/tr]
[tr][td]
23​
[/td][td][/td][td]Cameroon[/td][/tr]
[tr][td]
24​
[/td][td][/td][td]Canada[/td][/tr]
[tr][td]
25​
[/td][td][/td][td]Cape Verde[/td][/tr]
[tr][td]
26​
[/td][td][/td][td]Cayman Islands[/td][/tr]
[tr][td]
27​
[/td][td][/td][td]Chile[/td][/tr]
[tr][td]
28​
[/td][td][/td][td]Colombia[/td][/tr]
[tr][td]
29​
[/td][td][/td][td]Costa Rica[/td][/tr]
[tr][td]
30​
[/td][td][/td][td]Côte d'Ivoire[/td][/tr]
[tr][td]
31​
[/td][td][/td][td]Croatia[/td][/tr]
[tr][td]
32​
[/td][td][/td][td]Curacao[/td][/tr]
[tr][td]
33​
[/td][td][/td][td]Cyprus[/td][/tr]
[/table]


Does this do what you want?
 
Upvote 0

Forum statistics

Threads
1,223,162
Messages
6,170,431
Members
452,326
Latest member
johnshaji

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