Excel 2021 - FilterXML OpenWeatherMap Forecast API

BrerRabbit

Board Regular
Joined
Aug 20, 2023
Messages
84
Office Version
  1. 2021
  2. 2016
  3. 2013
Platform
  1. Windows
Prefer formula, not PQ. Learning PQ later.

OpenWeatherMap has a free API which will forecast weather every 3 hours for 5 days. That's alot of data.

I'm trying to devise a formula that will extract data from the API for a specific date and time. Using the following result from an API request, what is the correct formula to extract the min temperature from "2024-06-11T06:00:00 to=2024-06-11T09:00:00"?

@FILTERXML(L42,"weatherdata/forecast/time from=2024-06-11T06:00:00to=2024-06-11T09:00:00/temperature/@Min")

"<?xml version="1.0" encoding="UTF-8"?>
<weatherdata><location><name></name><type></type><country></country><timezone>36000</timezone>
<location altitude="0" latitude="27.6274" longitude="152.7713" geobase="geonames" geobaseid="0"></location></location>
<credit></credit><meta><lastupdate></lastupdate><calctime>0</calctime><nextupdate></nextupdate></meta>
<sun rise="2024-06-10T18:52:54" set="2024-06-11T08:44:24"></sun>
<forecast>
<time from="2024-06-11T06:00:00" to="2024-06-11T09:00:00">
<symbol number="500" name="light rain" var="10n"></symbol>
<precipitation probability="0.8" unit="3h" value="0.27" type="rain"></precipitation>
<windDirection deg="222" code="SW" name="Southwest"></windDirection><windSpeed mps="8.29" unit="m/s" name="Fresh Breeze"></windSpeed><windGust gust="10.76" unit="m/s"></windGust>
<temperature unit="celsius" value="26.92" min="26.83" max="26.92"></temperature><feels_like value="30.31" unit="celsius"></feels_like>
<pressure unit="hPa" value="1014"></pressure><humidity value="88" unit="%"></humidity>
<clouds value="overcast clouds" all="86" unit="%"></clouds><visibility value="10000"></visibility></time>
"
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)

Forum statistics

Threads
1,223,888
Messages
6,175,206
Members
452,618
Latest member
Tam84

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top