0
votes

I can't seem to make my formula work. Basically what I'm trying to archive here is to make the following function:

=ImportXML("https://anywebsite.com/product/"&C3;"//*[@id='content']")

Working with IF function, I assumed it would work the following way:

=IF(RegExMatch(D15;"#N/A"); ImportXML("https://anywebsite.com/product/"&C15;"//*[@id='content']/div[1]/div[2]/h1/span[2]/a[2]");"")

If the previous formula shows "#N/A" - it will run importXML and display results.

The ImportXML formula works just fine on its own.

Please help me out. Thank you in advance.

1

1 Answers

0
votes

Short Answer

Instead of REGEXMATCH use ISNA

Explanation

  • REGEXMATCH(A1,"#N/A") returns #N/A when A1 value is #N/A instead of TRUE
  • ISNA(A1) returns TRUE when A1 value is #N/A