Search code examples
google-sheetsformulaspreadsheet

In Google Sheet, replace the comma with a period and add EUR


Can you please tell me how to do it?

In Example No.1, you need to add a € sign before the number, and reduce the number of digits after the dot

Should show as: € 1.80

=ARRAY_CONSTRAIN(importXML("https://www.globalpetrolprices.com/Austria/", "//*[@id='graphPageLeft']/table[1]//tr"), 3 ^ 1, 4)

In Example No.2, you need to change the comma to a period and leave the number of zacks after the period Should show as: € 0.00

https://docs.google.com/spreadsheets/d/1ICQyiU9w-yHPynjJnx2S25Xah0GsFH5yzjATVSuZLVw/edit#gid=496450573

=QUERY(IMPORTXML("https://fuelo.eu/?convertto=eur", "//table[@class=('table table-striped table-hover tablesorter')]//tr"), "Select Col1, Col2, Col6, Col10 label Col1 'Countries', Col2 'Gasoline', Col6 'Diesel', Col10 'AutoGas'")


Solution

  • Example #1, try

    =query(ARRAY_CONSTRAIN(importXML("https://www.globalpetrolprices.com/Austria/", "//*[@id='graphPageLeft']/table[1]//tr"), 3, 4),"FORMAT Col3 '€ 0.00', Col4 '€ 0.00'",1)
    

    enter image description here

    Example #2

    =query(query(QUERY(IMPORTXML("https://fuelo.eu/?convertto=eur", "//table[@class=('table table-striped table-hover tablesorter')]//tr"), "Select Col1, Col2/1000, Col6/1000, Col10/1000 "),"select * format Col2 '€ 0.000',Col3 '€ 0.000',Col4 '€ 0.000' ",1),"label Col1 'Countries', Col2 'Gasoline', Col3 'Diesel', Col4 'AutoGas'",1)
    

    enter image description here