Formula to check if URL in cell A1
in a Google Spreadsheet is valid HTML, using the W3C HTML Checker API
=IF(A1<>"", IF(INDEX(IMPORTDATA("https://validator.w3.org/nu/?out=json&doc=" & A1), 0, 2) = "messages:[]}", "✓", "✗"), "")
- ✓ if no messages (errors or warnings) was returned
- ✗ if one or more messages (errors or warnings) was returned
- (empty) if the cell
A1
is empty
ISURL()
works too.