Search code examples
dategoogle-sheetsarray-formulasgoogle-sheets-formula

How to convert dates pulled from IMPORTXML to actual dates


I'm importing a 45-day weather forecast from https://weather.interia.com/long-term-forecast-chicago,cId,49700

The dates are listing like so:

1.11
2.11
3.11
4.11
5.11
6.11
7.11
8.11
9.11
10.11
11.11
12.11
13.11
14.11
15.11
16.11
17.11
18.11

How can I convert these to actual dates? TO_DATE hasn't worked. I appreciate any help.


Solution

  • try:

    =ARRAYFORMULA(DATE(YEAR(TODAY()), INDEX(SPLIT(IMPORTXML(
     "https://weather.interia.com/long-term-forecast-chicago,cId,49700", 
     "//span[@class='date']"), "."),,2), INDEX(SPLIT(IMPORTXML(
     "https://weather.interia.com/long-term-forecast-chicago,cId,49700", 
     "//span[@class='date']"), "."),,1)))
    

    0