Search code examples
google-sheetsgoogle-sheets-formula

Display Google Sheet IMPORTXML results horizontally


I want to enter data in the first column of Google Sheet. and the results in the second column should be displayed horizontally (using IMPORTXML) But now it is displayed vertically. This is my code:

=IMPORTXML("https://suggestqueries.google.com/complete/search?output=toolbar&hl=fa-IR&q=("&A2&")","//CompleteSuggestion/suggestion[1]/@data")

The output now looks like this: enter image description here

And I want it to be like this:

enter image description here

I tested the above piece of code in Google Sheets and the results are displayed vertically


Solution

  • Wrap torow() to your existing importxml formula

    =torow(<importxml_formula>)