EN VI

Google-sheets - Function ARRAY_ROW parameter 2 has mismatched row size. Expected: 4. Actual: 5?

2024-03-13 10:30:06
How to Google-sheets - Function ARRAY_ROW parameter 2 has mismatched row size. Expected: 4. Actual: 5

I have this spreadsheet: https://docs.google.com/spreadsheets/d/1YBXUdUJ8P-JT2MJznt8DseayhmHvkzQrGTF4AhVfi4U/edit#gid=0

I'm trying to filter the Datas tabs to only display some channels (Sports one).

The issue here, is when the filter doesn't match a row. For example, if I remove the lines 10 and 11 from Datas tab, the second tab works and I can see all the Sport channels.

The error I get from Google Sheet is:

Function ARRAY_ROW parameter 2 has mismatched row size. Expected: 4. Actual: 5. `

Do you know why ?

Solution:

Fix the Regular Expression Used

The error was on the second part of the formula. Apparently, the pattern used in the Like in the QUERY() is not an applicable regular expression for the REGEXMATCH() function. The pattern can be converted to a proper regular expression by replacing:

REGEXMATCH(Datas!A:A; "FR SPORTS | TV")

with:

REGEXMATCH(Datas!A:A; "(FR SPORTS \| TV)")

New formula:

={ARRAYFORMULA(SUBSTITUTE(REGEXEXTRACT(QUERY(Datas!A:A; "select A WHERE A LIKE '%FR SPORTS | TV%'"); "tvg-name=(.*)tvg-logo");"""";""))\FILTER(ROW(Datas!A:A); REGEXMATCH(Datas!A:A; "(FR SPORTS \| TV)"))}
Answer

Login


Forgot Your Password?

Create Account


Lost your password? Please enter your email address. You will receive a link to create a new password.

Reset Password

Back to login