Home > Enterprise >  Value (currency) not being imported correctly with importxml in Google Sheets (due to a dot when pri
Value (currency) not being imported correctly with importxml in Google Sheets (due to a dot when pri

Time:06-28

I have a question regarding the importxml function. At this moment I'm fetching the price of some of our travel pages to a Google Sheets list so we can track the price development of our packages (travel product, so prices are chaning all the time).

Now I'm facing the next problem. When I'm importing the price of a package that has a price higher than 999 euros (for example 1060 euros) the value I get in my Google Sheets is 1.06 (due to the use of a dot in between the 1 and the 0 (1.060 euros).

Is there a possiblility to import the full price in Google Sheets? Without the dot seperating the numbers?

Formula I use: =importxml(A2, "/html/body/div[7]/div[1]/section[1]/div[2]/div[1]/div/div[1]/div[1]/div/span[3]/span"))

Result I get:

€1.09

Result I should get:

€1090

Example sheet: https://docs.google.com/spreadsheets/d/1uzpLEhpjpVcZI8QTLx_Pz4EFL0YJMPHJU6WR1CVbZ-w/edit?usp=sharing

CodePudding user response:

try:

=SUBSTITUTE(TO_TEXT(IMPORTXML(A2, "/html/body/div[7]/div[1]/section[1]/div[2]/div[1]/div/div[1]/div[1]/div/span[3]/span"))), ".", )
  • Related