Importhtml Query Extract Between String

Viewed 38

I'm trying to find a formula that fits two tables

=QUERY(IMPORTHTML(A1,"table", 16), "Select Col4")

output is Page 1/10Page 2/10Page 3/10Page 4/10Page 5/10Page 6/10Page 7/10Page 8/10Page 9/10Page 10/10 Another:

=QUERY(IMPORTHTML(A2,"table", 16), "Select Col4")

output is Page 1/3Page 2/3Page 3/3

I want to extract the digits between "space" and "/" Is there a way to do this in this formula itself?

I then tried this

=transpose(SPLIT(REGEXREPLACE(A2,"Page|/10","~"),"~",0,1))

This also doesn't work since I have to manually change /10 to /3 in the second formula

Is there any way to achieve this for both data?

The sheet is here

1 Answers

try:

=ARRAYFORMULA(IF(ROW(A1:B)<=(1*{
 REGEXEXTRACT(IMPORTXML(A1, "//option[@value='21']"), "\d+$"), 
 REGEXEXTRACT(IMPORTXML(B1, "//option[@value='21']"), "\d+$")}), 
 ROW(A1:B), ))

enter image description here

Related