The IMPORTHTML version
I mentioned in my other answer that the data could be obtained using importhtml
. Well...
Note: Again, the results are formulas based on the original IMPORTHTML
formula. At some stage, one might wish to Copy, Paste special, Values only
to convert any given result to a value.
Some variables
Note that this version doesn't search for the star ("★") or half ("½") characters. This is because the format generated by importhtml
is completely different to the importxml
format.
IMPORTXTML Format >
Records with a rating (such as 'Guardians of the Galaxy') include 2 (two) carriage returns; records without a rating (such as 'Avengers: Infinity War') don't have any carriage returns.
So the spade character ('♠️') is used (substitute
) to identify those records with a rating and those without a rating.
ImportHTML
Cell A6: =arrayformula(SUBSTITUTE(SUBSTITUTE(importhtml($B$1;"list";14);char(10);"";1);char(10);"♠️";1))
This generates the following. Note: again this formula uses a semi-colon separator because that's what the OP uses.
Results
The results are broken into data elements (similar to the IMPORTXML
results). But this time, I've built single formulas for the 'Score', 'Name', 'Year' and 'Rating' and I'll show just those.
- Score (out of 100):
=arrayformula(value(left(A6:A105;search($B$2;A6:A105)-1)))
- Title/Name :
=arrayformula(if(iserr(search($B$3;A6:A105));mid(A6:A105;search($B$2;A6:A105)+1;len(A6:A105)-search($B$2;A6:A105)-4);mid(A6:A105;search($B$2;A6:A105)+1;search($B$3;A6:A105)-search($B$2;A6:A105)-1-4)))
- Year:
=arrayformula(if(iserr(search($B$3;A6:A105));right(A6:A105;4);mid(A6:A105;search($B$3;A6:A105)-4;4)))
- Rating:
=arrayformula(if(iserr(search($B$3;A6:A105));"";mid(A6:A105;search($B$3;A6:A105)+1;len(A6:A105)-search($B$3;A6:A105))))
1*SUBSTITUTE( )
, removing the commas altogether. This should convert them back to numbers. If this doesn't give the desired result. share a link to the sheet (or a copy of it), as that will be the only way to test anything further.