<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Glen Gilchrist</title>
	<atom:link href="http://www.glengilchrist.co.uk/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.glengilchrist.co.uk</link>
	<description>Splendiferous Excel</description>
	<lastBuildDate>Tue, 23 Apr 2013 10:22:38 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>Using Google Url Shrinker inside Excel</title>
		<link>http://www.glengilchrist.co.uk/using-google-url-shrinker-inside-excel/</link>
		<comments>http://www.glengilchrist.co.uk/using-google-url-shrinker-inside-excel/#comments</comments>
		<pubDate>Tue, 23 Apr 2013 10:20:25 +0000</pubDate>
		<dc:creator>Glen Gilchrist</dc:creator>
				<category><![CDATA[Excel]]></category>
		<category><![CDATA[excel]]></category>
		<category><![CDATA[ukedchat]]></category>

		<guid isPermaLink="false">http://www.glengilchrist.co.uk/?p=2096</guid>
		<description><![CDATA[The project I&#8217;m currently working on requires me to collate web links into a regular Tweet. &#160;All good &#8211; use of Excel to collate the list and liberal CONCATENATES() soon work up the Tweet + #tags.&#160;
A LEN() lets me monitor the length of the Tweet so that I don&#8217;t go over 140 characters in total.
Where I run into a workflow ...]]></description>
				<content:encoded><![CDATA[<p>The project I&#8217;m currently working on requires me to collate web links into a regular Tweet. &nbsp;All good &#8211; use of Excel to collate the list and liberal CONCATENATES() soon work up the Tweet + #tags.&nbsp;</p>
<p>A LEN() lets me monitor the length of the Tweet so that I don&#8217;t go over 140 characters in total.</p>
<p>Where I run into a workflow issue is with the URL itself. &nbsp;I don&#8217;t want to use the full URL as it will take precious characters from my 140 &#8211; so I use a URL shortening service such as <a title="Url shortening from Google" href="http://goo.gl/">Goo.gl</a>. But that means I need to copy, paste into Goo.gl and copy paste back into Excel. &nbsp;There must be an easier way.</p>
<p>Google lets us access the Goo.gl service via its API. &nbsp;Log into your Google account and visit:&nbsp;<a title="Google APIs" href="https://code.google.com/apis/console">https://code.google.com/apis/console</a>&nbsp; &#8211; towards the bottom, you can choose to enable the&nbsp;<strong>URL Shortener API</strong>. &nbsp;With 1,000,000 requests per day, I am sure I&#8217;ll never over do it.</p>
<p>Once enabled you need to get your API Key. &nbsp;This is unique to you, so don&#8217;t share it.</p>
<p><strong>In Excel, VBA &#8211; Insert a new Module</strong></p>
<p>Now cut and paste this code, to make a new function <strong>GetGooglURL</strong></p>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="vb.net"><div class="devcodeoverflow"><ol><li><span style="color: #0000FF; font-weight: bold;">Const</span> API_KEY <span style="color: #0000FF; font-weight: bold;">As</span> <span style="color: #6a5acd;">String</span> <span style="color: #000000;">=</span> <span style="color: #a52a2a; back-color: #fffacd;">&quot;YOUR API KEY HERE&quot;</span></li><li><span style="color: #0000FF; font-weight: bold;">Const</span> BASEURL <span style="color: #0000FF; font-weight: bold;">As</span> <span style="color: #6a5acd;">String</span> <span style="color: #000000;">=</span> <span style="color: #a52a2a; back-color: #fffacd;">&quot;https://www.googleapis.com/urlshortener/v1/url&quot;</span></li><li>&nbsp;</li><li><span style="color: #0000FF; font-weight: bold;">Function</span> GetGooglURL<span style="color: #000000;">&#40;</span>url <span style="color: #0000FF; font-weight: bold;">As</span> <span style="color: #6a5acd;">String</span><span style="color: #000000;">&#41;</span> <span style="color: #0000FF; font-weight: bold;">As</span> <span style="color: #6a5acd;">String</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;<span style="color: #0000FF; font-weight: bold;">Dim</span> xml <span style="color: #0000FF; font-weight: bold;">As</span> <span style="color: #6a5acd;">Object</span>&nbsp;&nbsp;<span style="color: #008000; font-style: italic;">' MSXML2.XMLHTTP60</span></li><li>&nbsp;&nbsp;<span style="color: #0000FF; font-weight: bold;">Set</span> xml <span style="color: #000000;">=</span> <span style="color: #000066;">CreateObject</span><span style="color: #000000;">&#40;</span><span style="color: #a52a2a; back-color: #fffacd;">&quot;MSXML2.XMLHTTP.6.0&quot;</span><span style="color: #000000;">&#41;</span> </li><li>&nbsp;</li><li>&nbsp;&nbsp;<span style="color: #0000FF; font-weight: bold;">If</span> xml <span style="color: #0000FF; font-weight: bold;">Is</span> <span style="color: #0000FF; font-weight: bold;">Nothing</span> <span style="color: #0000FF; font-weight: bold;">Then</span> <span style="color: #0000FF; font-weight: bold;">Exit</span> <span style="color: #0000FF; font-weight: bold;">Function</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;<span style="color: #0000FF; font-weight: bold;">With</span> xml</li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000000;">.</span><span style="color: #000000;">Open</span> <span style="color: #a52a2a; back-color: #fffacd;">&quot;POST&quot;</span>, BASEURL <span style="color: #000000;">&amp;</span> <span style="color: #a52a2a; back-color: #fffacd;">&quot;?key=&quot;</span> <span style="color: #000000;">&amp;</span> API_KEY, <span style="color: #0000FF; font-weight: bold;">False</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000000;">.</span><span style="color: #000000;">setRequestHeader</span> <span style="color: #a52a2a; back-color: #fffacd;">&quot;Content-Type&quot;</span>, <span style="color: #a52a2a; back-color: #fffacd;">&quot;application/json&quot;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000000;">.</span><span style="color: #000000;">Send</span> <span style="color: #000066;">Replace</span><span style="color: #000000;">&#40;</span><span style="color: #a52a2a; back-color: #fffacd;">&quot;{&quot;</span><span style="color: #a52a2a; back-color: #fffacd;">&quot;longUrl&quot;</span><span style="color: #a52a2a; back-color: #fffacd;">&quot;: &quot;</span><span style="color: #a52a2a; back-color: #fffacd;">&quot;http://www.google.com/&quot;</span><span style="color: #a52a2a; back-color: #fffacd;">&quot;}&quot;</span>, <span style="color: #a52a2a; back-color: #fffacd;">&quot;http://www.google.com/&quot;</span>, url<span style="color: #000000;">&#41;</span></li><li>&nbsp;&nbsp;<span style="color: #0000FF; font-weight: bold;">End</span> <span style="color: #0000FF; font-weight: bold;">With</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;<span style="color: #0000FF; font-weight: bold;">If</span> <span style="color: #000066;">InStr</span><span style="color: #000000;">&#40;</span>xml<span style="color: #000000;">.</span><span style="color: #000000;">responseText</span>, <span style="color: #a52a2a; back-color: #fffacd;">&quot;error&quot;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">=</span> <span style="color: #a52a2a; back-color: #fffacd;">0</span> <span style="color: #0000FF; font-weight: bold;">Then</span>&nbsp;&nbsp;<span style="color: #008000; font-style: italic;">' no error occurred</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #008000; font-style: italic;">' parse out short URL from JSON response</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;GetGooglURL <span style="color: #000000;">=</span> <span style="color: #000066;">Trim$</span><span style="color: #000000;">&#40;</span><span style="color: #000066;">Split</span><span style="color: #000000;">&#40;</span>xml<span style="color: #000000;">.</span><span style="color: #000000;">responseText</span>, <span style="color: #a52a2a; back-color: #fffacd;">&quot;&quot;</span><span style="color: #a52a2a; back-color: #fffacd;">&quot;&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#40;</span><span style="color: #a52a2a; back-color: #fffacd;">7</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span></li><li>&nbsp;&nbsp;<span style="color: #0000FF; font-weight: bold;">End</span> <span style="color: #0000FF; font-weight: bold;">If</span></li><li>&nbsp;</li><li><span style="color: #0000FF; font-weight: bold;">End</span> <span style="color: #0000FF; font-weight: bold;">Function</span></li><li></li></ol></div></pre><!--END_DEVFMTCODE--></p>
<p style="text-align: center;"><a href="http://www.glengilchrist.co.uk/wp-content/uploads/2013/04/shrunkURL.png"><img class="aligncenter size-large wp-image-2097" style="border: 0px;" alt="Google URL Shrinker inside Excel" src="http://www.glengilchrist.co.uk/wp-content/uploads/2013/04/shrunkURL-700x159.png" width="700" height="159" /></a></p>
<p>Using this is simplicity itself. &nbsp;In cell B2 is the long URL you want to shorten.</p>
<p>C2=GetGooglURL(B2) &#8211; sends the long URL to Google for shortening and displays in A2 the short version.</p>
<p>Splendiferous Excel and Web Api to the rescue again.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.glengilchrist.co.uk/using-google-url-shrinker-inside-excel/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Consuming XML with Excel 2013 Webservices</title>
		<link>http://www.glengilchrist.co.uk/consuming-xml-with-excel-2013-webservices/</link>
		<comments>http://www.glengilchrist.co.uk/consuming-xml-with-excel-2013-webservices/#comments</comments>
		<pubDate>Mon, 22 Apr 2013 14:51:16 +0000</pubDate>
		<dc:creator>Glen Gilchrist</dc:creator>
				<category><![CDATA[Excel]]></category>
		<category><![CDATA[ukedchat]]></category>

		<guid isPermaLink="false">http://www.glengilchrist.co.uk/?p=2092</guid>
		<description><![CDATA[Big data is the darling of newspapers at present &#8211; you know, everything we do is logged and if we could just, in some way makes sense of it all, we would: find a cure for cancer / get better ads to our mobile phones / find terrorists (delete as appropriate). &#160;One of the realities of Big Data &#8211; is ...]]></description>
				<content:encoded><![CDATA[<p>Big data is the darling of newspapers at present &#8211; you know, everything we do is logged and if we could just, in some way makes sense of it all, we would: find a cure for cancer / get better ads to our mobile phones / find terrorists (delete as appropriate). &nbsp;One of the realities of Big Data &#8211; is that it&#8217;s out there &#8211; if you know where to look you can find a data source.</p>
<p>Excel 2013 can consume that data using the built in WEBSERVICE and FILTERXML &nbsp;functions.</p>
<p>WEBSERVICE reaches out to &#8220;big data&#8221; land and pulls into Excel an XML data feed.</p>
<p>FILTERXML extracts specific pieces of information from that feed.</p>
<p>&nbsp;</p>
<p><strong>For example:</strong></p>
<p><a href="http://www.theyworkforyou.com/">http://www.theyworkforyou.com</a>&nbsp;provides details on MPs and a searchable database of who does what. &nbsp;Using their API you can extract that information yourself.</p>
<p>Register for an API Key <a title="API Key" href="http://www.theyworkforyou.com/api/" target="_blank">here </a>(An API key is a unique reference that lets you access the data. &nbsp;This is free, and it allows the site owner to track who is consuming what from their site. &nbsp;It also allows them to&nbsp;rescind&nbsp;your key, should you abuse the service).</p>
<p>Once you have your OWN API key, form a URL as follows, and replace with your own API Key:</p>
<p>&nbsp;</p>
<p><strong>http://www.theyworkforyou.com/api/getMP?key=APIKEYGOESHERE&amp;output=xml&amp;postcode=np109jn</strong></p>
<p>&nbsp;</p>
<p>This returns informantion on the MP for NP109JN:</p>
<p style="text-align: center;"><a href="http://www.glengilchrist.co.uk/wp-content/uploads/2013/04/mpxml.png"><img class="aligncenter size-full wp-image-2093" style="border: 0px;" alt="Consume XML with Excel" src="http://www.glengilchrist.co.uk/wp-content/uploads/2013/04/mpxml.png" width="506" height="388" /></a></p>
<p style="text-align: left;">This is the XML outout &#8211; it looks daunting, but its not:</p>
<p style="text-align: left;"><strong>&lt;twfy&gt;</strong> is the top level holder inside which all the data is contatined:</p>
<p style="text-align: left;"><strong>&lt;member_id&gt;</strong>4042<strong>4&lt;/member_id&gt;</strong> &nbsp;is a data element c&nbsp;containing&nbsp;the member_id for this record.</p>
<p style="text-align: left;"><strong>&lt;first_name&gt;</strong>Paul<strong>&lt;/first_name&gt;</strong> is another data element containing the first_name record</p>
<p style="text-align: left;">&nbsp;</p>
<p style="text-align: left;">As you can see each data&nbsp;element&nbsp;is surrounded by <strong>&lt;label&gt; &lt;/label&gt;</strong> , which locates the data.</p>
<p style="text-align: left;">At the end, we have <strong><!--<span class="hiddenSpellError" pre=""-->twfy&gt;</strong> which pairs up with the opening <strong>&lt;twfy&gt;.</strong></p>
<p style="text-align: left;">&nbsp;</p>
<p style="text-align: left;">Just like HTML, you can think of the&nbsp;<strong>&lt;label&gt; &lt;/label&gt;</strong> pair as turning the label on and off &#8211; so they need to be paired.</p>
<p style="text-align: left;">&nbsp;</p>
<p style="text-align: left;">Becuase the data is so structured, Excel 2013 can simply import it:</p>
<p style="text-align: left;">A1=WEBSERVICE(&#8220;http://www.theyworkforyou.com/api/getMP?key=<strong>YOUAPIKEY</strong>&amp;output=xml&amp;postcode=np109jn&#8221;)</p>
<p style="text-align: left;">will pull the XML from the URL into cell A1 (you need your <strong>API</strong> key again)</p>
<p style="text-align: left;">&nbsp;</p>
<p style="text-align: left;">To get the individual data you need to find the labels:</p>
<p style="text-align: left;">Notice towards the end of the XML screenshot above the pair <strong>&lt;full_name&gt;</strong>Paul Flynn<strong>&lt;full_name&gt;</strong>. &nbsp;To navigate through the XML tree we use:</p>
<p style="text-align: left;"><strong>//twfy/full_name.</strong></p>
<p style="text-align: left;">To get Excel to extract this, we use: &nbsp;A2=FILTERXML(A1,&#8221;//twfy/full_name&#8221;) &nbsp;&#8211; which displays in A2, Paul Flynn.</p>
<p style="text-align: left;">&nbsp;</p>
<p style="text-align: left;">Similarly, to extract any of the data, we just replace <strong>//twfy/full_name</strong> with the data element we want.</p>
<p style="text-align: left;">&nbsp;</p>
<p style="text-align: left;">So, splendiferous Excel can consume XML with ease using WEBSERICE and FILTERXML.</p>
<p style="text-align: left;">&nbsp;</p>
<p style="text-align: left;">&nbsp;</p>
<p style="text-align: left;">&nbsp;</p>
<p style="text-align: left;">&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.glengilchrist.co.uk/consuming-xml-with-excel-2013-webservices/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using Excel 2013 Webservice to get Latitude and Longitude for a PostCode</title>
		<link>http://www.glengilchrist.co.uk/using-excel-2013-webservice-to-get-latitude-and-longitude-for-a-postcode/</link>
		<comments>http://www.glengilchrist.co.uk/using-excel-2013-webservice-to-get-latitude-and-longitude-for-a-postcode/#comments</comments>
		<pubDate>Sat, 20 Apr 2013 10:58:20 +0000</pubDate>
		<dc:creator>Glen Gilchrist</dc:creator>
				<category><![CDATA[Excel]]></category>
		<category><![CDATA[ukedchat]]></category>

		<guid isPermaLink="false">http://www.glengilchrist.co.uk/?p=2088</guid>
		<description><![CDATA[My previous post on getting the distance between postcodes with Google Maps API and Excel, got me thinking about mapping and Excel &#8211; one thing led to another and I ended up thinking about latitude and longitude.
Google Map API has:
http://maps.googleapis.com/maps/api/geocode/xml?address=CA11BP+,+&#38;sensor=false, which returns XML for the postcode CA1 1BP. &#160;In that XML&#160;response we can find the latitude and longitude:
&#160;

One of the ...]]></description>
				<content:encoded><![CDATA[<p>My previous post on <a title="Distance between postcodes with Google Maps API" href="http://www.glengilchrist.co.uk/distance-between-postcodes-using-excel-and-google-maps-api/" target="_blank">getting the distance between postcodes</a> with Google Maps API and Excel, got me thinking about mapping and Excel &#8211; one thing led to another and I ended up thinking about latitude and longitude.</p>
<p><strong>Google Map API has:</strong></p>
<p><a href="http://maps.googleapis.com/maps/api/geocode/xml?address=CA11BP+,+&amp;sensor=false">http://maps.googleapis.com/maps/api/geocode/xml?address=CA11BP+,+&amp;sensor=false</a>, which returns XML for the postcode CA1 1BP. &nbsp;In that XML&nbsp;response we can find the latitude and longitude:</p>
<p>&nbsp;</p>
<p style="text-align: center;"><a href="http://www.glengilchrist.co.uk/wp-content/uploads/2013/04/latlong.png"><img class="aligncenter size-large wp-image-2089" style="border: 0px;" alt="Google Map API Latitude and Longitude" src="http://www.glengilchrist.co.uk/wp-content/uploads/2013/04/latlong-683x700.png" width="683" height="700" /></a></p>
<p style="text-align: left;">One of the splendiferous new features of Excel 2013 is its ability to reach out to web data services and to import XML straight into your worksheet:</p>
<p style="text-align: left;"><strong>A1=WEBSERVICE(&#8220;http://maps.googleapis.com/maps/api/geocode/xml?address=CA11BP+,+&amp;sensor=false&#8221;)</strong>,&nbsp;will reach out to the Google Maps API and import into Excel the same XML tree as previously displayed.</p>
<p style="text-align: left;">Now we need to prune the tree to find the data element we need:</p>
<p style="text-align: left;"><strong>B1=FILTERXML(A1,&#8221;//result/geometry/location/lat&#8221;)</strong>, takes the result in A1 and prunes the tree at /result/geometry/location/lat.</p>
<p style="text-align: left;">
The final /lat is the data element containing, in this case 54.8948900</p>
<p style="text-align: left;">In the same way, <strong>C1=FILTERXML(A1,&#8221;//result/geometry/location/lng&#8221;)</strong>, will return the longitude of -2.9311223.</p>
<p style="text-align: left;">&nbsp;</p>
<p style="text-align: left;"><strong>We used:</strong></p>
<p style="text-align: left;"><strong>WEBSERVICE(URL)</strong> to pull in an XML response from your input URL</p>
<p style="text-align: left;"><strong>FILTERXML(xml.xpath)</strong>, where xml is the cell containing the result of Webservice and xpath is the tree location of the data.</p>
<p style="text-align: left;">&nbsp;</p>
<p style="text-align: left;">Totally splendiferous Excel 2013 features.</p>
<p style="text-align: left;">&nbsp;</p>
<p style="text-align: left;">&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.glengilchrist.co.uk/using-excel-2013-webservice-to-get-latitude-and-longitude-for-a-postcode/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Distance between postcodes (Using Excel and Google Maps API)</title>
		<link>http://www.glengilchrist.co.uk/distance-between-postcodes-using-excel-and-google-maps-api/</link>
		<comments>http://www.glengilchrist.co.uk/distance-between-postcodes-using-excel-and-google-maps-api/#comments</comments>
		<pubDate>Sun, 07 Apr 2013 17:06:17 +0000</pubDate>
		<dc:creator>Glen Gilchrist</dc:creator>
				<category><![CDATA[Excel]]></category>
		<category><![CDATA[ukedchat]]></category>

		<guid isPermaLink="false">http://www.glengilchrist.co.uk/?p=2075</guid>
		<description><![CDATA[I&#8217;m lucky enough to be on a&#160;sabbatical from being STL Science. &#160;As a result I need to claim travelling expenses &#8211; no biggie and the electronic system that the Welsh Government has&#160;&#160;makes things quite simple. &#160;
I need to estimate the distance between two locations, so I &#160;turn to Google Maps and enter the postcodes &#8211; simple, accurate enough, and&#160;relatively quick.
But ...]]></description>
				<content:encoded><![CDATA[<p>I&#8217;m lucky enough to be on a&nbsp;sabbatical from being STL Science. &nbsp;As a result I need to claim travelling expenses &#8211; no biggie and the electronic system that the Welsh Government has&nbsp;&nbsp;makes things quite simple. &nbsp;</p>
<p>I need to estimate the distance between two locations, so I &nbsp;turn to Google Maps and enter the postcodes &#8211; simple, accurate enough, and&nbsp;relatively quick.</p>
<p>But there is another way &#8211; splendiferous Excel to the answer.</p>
<p style="text-align: center;"><a href="http://www.glengilchrist.co.uk/wp-content/uploads/2013/04/googlemapkm_mile.xlsm">Download GoogleMap Postcode distance calculator</a></p>
<p>Consider these two postcodes:</p>
<table style="width: 208px;" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td width="104" height="20"><strong>CF10 3NQ</strong></td>
<td width="104"><strong>GL52 5JT</strong></td>
</tr>
</tbody>
</table>
<p><strong>&nbsp;In GoogleMaps this looks like this:</strong></p>
<p style="text-align: center;"><a href="http://www.glengilchrist.co.uk/wp-content/uploads/2013/04/googlemaps.jpg"><img class="aligncenter size-large wp-image-2077" style="border: 0px;" alt="GoogleMaps" src="http://www.glengilchrist.co.uk/wp-content/uploads/2013/04/googlemaps-700x354.jpg" width="700" height="354" /></a></p>
<p style="text-align: left;">Fine &#8211; the distance between these postcodes is 71.1 miles.</p>
<p style="text-align: left;">What if I want this information into a spreadsheet?</p>
<p style="text-align: left;">GoogleMaps API allows you to query Google and extract exactly this information. &nbsp;ALT-F11 and into a new Module copy and paste this code:</p>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="vb.net"><div class="devcodeoverflow"><ol><li><span style="color: #0000FF; font-weight: bold;">Function</span> G_DISTANCE<span style="color: #000000;">&#40;</span>Origin <span style="color: #0000FF; font-weight: bold;">As</span> <span style="color: #6a5acd;">String</span>, Destination <span style="color: #0000FF; font-weight: bold;">As</span> <span style="color: #6a5acd;">String</span><span style="color: #000000;">&#41;</span> <span style="color: #0000FF; font-weight: bold;">As</span> <span style="color: #6a5acd;">Double</span></li><li><span style="color: #008000; font-style: italic;">' Requires a reference to Microsoft XML, v6.0</span></li><li><span style="color: #008000; font-style: italic;">' Draws on&nbsp;&nbsp;http://oco-carbon.com/?p=553 </span></li><li>&nbsp;</li><li><span style="color: #0000FF; font-weight: bold;">Dim</span> myRequest <span style="color: #0000FF; font-weight: bold;">As</span> XMLHTTP60</li><li><span style="color: #0000FF; font-weight: bold;">Dim</span> myDomDoc <span style="color: #0000FF; font-weight: bold;">As</span> DOMDocument60</li><li><span style="color: #0000FF; font-weight: bold;">Dim</span> distanceNode <span style="color: #0000FF; font-weight: bold;">As</span> IXMLDOMNode</li><li>&nbsp;&nbsp;&nbsp;&nbsp;G_DISTANCE <span style="color: #000000;">=</span> <span style="color: #a52a2a; back-color: #fffacd;">0</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #008000; font-style: italic;">' Check and clean inputs</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000FF; font-weight: bold;">On</span> <span style="color: #0000FF; font-weight: bold;">Error</span> <span style="color: #0000FF; font-weight: bold;">GoTo</span> exitRoute</li><li>&nbsp;&nbsp;&nbsp;&nbsp;Origin <span style="color: #000000;">=</span> <span style="color: #000066;">Replace</span><span style="color: #000000;">&#40;</span>Origin, <span style="color: #a52a2a; back-color: #fffacd;">&quot; &quot;</span>, <span style="color: #a52a2a; back-color: #fffacd;">&quot;%20&quot;</span><span style="color: #000000;">&#41;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;Destination <span style="color: #000000;">=</span> <span style="color: #000066;">Replace</span><span style="color: #000000;">&#40;</span>Destination, <span style="color: #a52a2a; back-color: #fffacd;">&quot; &quot;</span>, <span style="color: #a52a2a; back-color: #fffacd;">&quot;%20&quot;</span><span style="color: #000000;">&#41;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #008000; font-style: italic;">' Read the XML data from the Google Maps API</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000FF; font-weight: bold;">Set</span> myRequest <span style="color: #000000;">=</span> <span style="color: #0000FF; font-weight: bold;">New</span> XMLHTTP60</li><li>&nbsp;&nbsp;&nbsp;&nbsp;myRequest<span style="color: #000000;">.</span><span style="color: #000000;">Open</span> <span style="color: #a52a2a; back-color: #fffacd;">&quot;GET&quot;</span>, <span style="color: #a52a2a; back-color: #fffacd;">&quot;http://maps.googleapis.com/maps/api/directions/xml?origin=&quot;</span> _</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000000;">&amp;</span> Origin <span style="color: #000000;">&amp;</span> <span style="color: #a52a2a; back-color: #fffacd;">&quot;&amp;destination=&quot;</span> <span style="color: #000000;">&amp;</span> Destination <span style="color: #000000;">&amp;</span> <span style="color: #a52a2a; back-color: #fffacd;">&quot;&amp;sensor=false&quot;</span>, <span style="color: #0000FF; font-weight: bold;">False</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;myRequest<span style="color: #000000;">.</span><span style="color: #000000;">send</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #008000; font-style: italic;">' Make the XML readable usign XPath</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000FF; font-weight: bold;">Set</span> myDomDoc <span style="color: #000000;">=</span> <span style="color: #0000FF; font-weight: bold;">New</span> DOMDocument60</li><li>&nbsp;&nbsp;&nbsp;&nbsp;myDomDoc<span style="color: #000000;">.</span><span style="color: #000000;">LoadXML</span> myRequest<span style="color: #000000;">.</span><span style="color: #000000;">responseText</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #008000; font-style: italic;">' Get the distance node value</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000FF; font-weight: bold;">Set</span> distanceNode <span style="color: #000000;">=</span> myDomDoc<span style="color: #000000;">.</span><span style="color: #000000;">SelectSingleNode</span><span style="color: #000000;">&#40;</span><span style="color: #a52a2a; back-color: #fffacd;">&quot;//leg/distance/value&quot;</span><span style="color: #000000;">&#41;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000FF; font-weight: bold;">If</span> <span style="color: #0000FF; font-weight: bold;">Not</span> distanceNode <span style="color: #0000FF; font-weight: bold;">Is</span> <span style="color: #0000FF; font-weight: bold;">Nothing</span> <span style="color: #0000FF; font-weight: bold;">Then</span> G_DISTANCE <span style="color: #000000;">=</span> <span style="color: #000000;">&#40;</span>distanceNode<span style="color: #000000;">.</span><span style="color: #000000;">Text</span> <span style="color: #000000;">/</span> <span style="color: #a52a2a; back-color: #fffacd;">1000</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">*</span> <span style="color: #a52a2a; back-color: #fffacd;">0.621371192</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #008000; font-style: italic;">'the 0.621371192 converts from kilometers to miles</span></li><li>exitRoute:</li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #008000; font-style: italic;">' Tidy up</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000FF; font-weight: bold;">Set</span> distanceNode <span style="color: #000000;">=</span> <span style="color: #0000FF; font-weight: bold;">Nothing</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000FF; font-weight: bold;">Set</span> myDomDoc <span style="color: #000000;">=</span> <span style="color: #0000FF; font-weight: bold;">Nothing</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000FF; font-weight: bold;">Set</span> myRequest <span style="color: #000000;">=</span> <span style="color: #0000FF; font-weight: bold;">Nothing</span></li><li><span style="color: #0000FF; font-weight: bold;">End</span> <span style="color: #0000FF; font-weight: bold;">Function</span></li></ol></div></pre><!--END_DEVFMTCODE--></p>
<p>Before you run the code, you will need to include a reference to Microsoft XML, v6.0 in the VBA editor. &nbsp;(Tools &gt; References &gt; Microsoft XML, v6.0 )</p>
<p>The code creates a new Excel function&nbsp;<strong>G_DISTANCE</strong>(Origin,Destination).</p>
<p>In Excel C2=G_DISTANCE(A2,B2) &nbsp;returns 71.1 &#8212; the distance between these postcodes.</p>
<p style="text-align: center;"><a href="http://www.glengilchrist.co.uk/wp-content/uploads/2013/04/googleapi.png"><img class="aligncenter size-full wp-image-2078" style="border: 0px;" alt="Adding GoogleMaps API to Excel" src="http://www.glengilchrist.co.uk/wp-content/uploads/2013/04/googleapi.png" width="550" height="141" /></a></p>
<p style="text-align: left;">Now I have a quick and easy way to calculate the distance between postcodes &#8211; and the data is available straight into Excel as a formula. &nbsp;Splendiferous.</p>
<p style="text-align: center;"><a href="http://www.glengilchrist.co.uk/wp-content/uploads/2013/04/googlemapkm_mile.xlsm">Download GoogleMap Postcode distance calculator</a></p>
<p style="text-align: left;">&nbsp;</p>
<p style="text-align: left;"><strong>Correction</strong>: &nbsp;When this post went up, I commented on a bitcoin miner being installed. &nbsp;I was incorrect and should have explored the site more. &nbsp;When on the site, a bitcoin miner runs in the background, donating some of your CPU cycles to mining bitcoins. &nbsp; &nbsp;Many&nbsp;apologies&nbsp;for implying that this might have been nefarious.</p>
<p style="text-align: left;">&nbsp;</p>
<p style="text-align: left;">Original code from: &nbsp;<a href="http://oco-carbon.com/2012/03/06/google-excel-distance-function/">http://oco-carbon.com/2012/03/06/google-excel-distance-function/</a>&nbsp; modified to display miles instead of Km.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.glengilchrist.co.uk/distance-between-postcodes-using-excel-and-google-maps-api/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Non &#8220;recalculating&#8221; random numbers in Excel</title>
		<link>http://www.glengilchrist.co.uk/non-recalculating-random-numbers-in-excel/</link>
		<comments>http://www.glengilchrist.co.uk/non-recalculating-random-numbers-in-excel/#comments</comments>
		<pubDate>Sat, 06 Apr 2013 17:05:56 +0000</pubDate>
		<dc:creator>Glen Gilchrist</dc:creator>
				<category><![CDATA[Excel]]></category>
		<category><![CDATA[ukedchat]]></category>

		<guid isPermaLink="false">http://www.glengilchrist.co.uk/?p=2071</guid>
		<description><![CDATA[I&#8217;ve blogged before about using Excel to create data for learners to analyse (specifically in BTEC Science) . &#160;To create a different set of data for each learner we use the RAND() or RANDBETWEEN() &#160;functions in Excel.&#160;
One thing that these functions do is automatically recalculate -&#160;every time&#160;Excel&#160;calculates ANY cell, ALL the RAND functions update, with another random number. &#160;Literally entering ...]]></description>
				<content:encoded><![CDATA[<p>I&#8217;ve blogged before about using Excel to create data for learners to analyse (specifically in BTEC Science) . &nbsp;To create a different set of data for each learner we use the RAND() or RANDBETWEEN() &nbsp;functions in Excel.&nbsp;</p>
<p>One thing that these functions do is automatically recalculate -&nbsp;every time&nbsp;Excel&nbsp;calculates ANY cell, ALL the RAND functions update, with another random number. &nbsp;Literally entering content into a cell will cause all the RAND(s) to change. &nbsp;OK &#8211; this does what it says &#8211; creates random numbers, but that means that if you use them in a worksheet and SAVE that sheet &#8211; the version of the file that you re-open will have different numbers, as the RAND(s) will recalculate.</p>
<p>You can simulate this by pressing F9 &#8211; this forces Excel to recalculate. &nbsp;Every cell that depends on a RAND will change.</p>
<p>&nbsp;</p>
<p>What if we want to use random numbers, but for the values to be &#8220;fixed&#8221; once the data has been generated?</p>
<p style="text-align: center;"><a href="http://www.glengilchrist.co.uk/wp-content/uploads/2013/04/fixedRandom.xlsm">Download Fixed Random Numbers Worksheet</a></p>
<p><strong>2 Ways to &#8220;fix&#8221; random numbers</strong>&nbsp;</p>
<p>1) Set up the worksheet using the RANDS, then copy and paste everything back into the same place, but using the Paste-Special Values option. &nbsp; This works, but it fundamentally changes the spreadsheet as it removes the calculations and stores just numbers.</p>
<p style="text-align: center;"><a href="http://www.glengilchrist.co.uk/wp-content/uploads/2013/04/fixedrandom.png"><img class="aligncenter size-full wp-image-2072" style="border: 0px;" alt="Creating fixed random numbers in Excel" src="http://www.glengilchrist.co.uk/wp-content/uploads/2013/04/fixedrandom.png" width="688" height="464" /></a></p>
<p>2) <strong>Create a custom function.</strong></p>
<p>Create a new function as per the instructions above.</p>
<p>Now in your worksheet enter B2=MyRand() &nbsp;&#8211; Excel will insert a random number in B2, but it wont recalculate when you press F9 or enter more data.</p>
<p>Compare this to the working of A2=Rand(), which constantly updates.</p>
<p>&nbsp;</p>
<p>A splendiferous way to insert random numbers without them updating /&nbsp;changing&nbsp;all the time.</p>
<p>&nbsp;</p>
<p style="text-align: center;"><a href="http://www.glengilchrist.co.uk/wp-content/uploads/2013/04/fixedRandom.xlsm">Download Fixed Random Numbers Worksheet</a></p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.glengilchrist.co.uk/non-recalculating-random-numbers-in-excel/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Personalised &#8220;flipped&#8221; revision</title>
		<link>http://www.glengilchrist.co.uk/personalised-flipped-revision/</link>
		<comments>http://www.glengilchrist.co.uk/personalised-flipped-revision/#comments</comments>
		<pubDate>Thu, 04 Apr 2013 12:10:52 +0000</pubDate>
		<dc:creator>Glen Gilchrist</dc:creator>
				<category><![CDATA[Education]]></category>
		<category><![CDATA[asechat]]></category>
		<category><![CDATA[ukedchat]]></category>

		<guid isPermaLink="false">http://www.glengilchrist.co.uk/?p=2065</guid>
		<description><![CDATA[I&#8217;m fortunate enough to tutor a few learners in GCSE Science -&#160;fortunate&#160;as it&#160;allows&#160;me to spend more than 2 or 3 minutes actually diagnosing learning &#8220;blocks&#8221; and it gives me the time to actually explain concepts fully. &#160;
Anyway, I am currently tutoring a young lady by the name of Sam (I asked her if I could release this post and she ...]]></description>
				<content:encoded><![CDATA[<p>I&#8217;m fortunate enough to tutor a few learners in GCSE Science -&nbsp;fortunate&nbsp;as it&nbsp;allows&nbsp;me to spend more than 2 or 3 minutes actually diagnosing learning &#8220;blocks&#8221; and it gives me the time to actually explain concepts fully. &nbsp;</p>
<p>Anyway, I am currently tutoring a young lady by the name of Sam (I asked her if I could release this post and she thought it was &#8220;sick&#8221; &#8211; which I think is good) &#8211; who asked me if I could make her some&nbsp;videos&nbsp;that she could watch to help her revise for GCSE&nbsp;Science.</p>
<p>Initially I was not sure where to go with this &#8211; as:</p>
<ol>
<li><span style="line-height: 13px;">Whilst I&#8217;ve made YouTube&nbsp;content&nbsp;before, most of it was to support my classes</span></li>
<li>Recording my voice and preparing a lesson for recording seemed like more effort than I was willing to expend (even for Sam &#8211; sorry ;-( )</li>
<li>Maybe I should just record my tutorials and let Sam listen / watch on her own time? &nbsp;(Whilst appealing, this meant that only Sam could watch them as she did not want to be in them online).</li>
</ol>
<p>However, I said I&#8217;d see what I could do.</p>
<p>So, I turned to<a href="http://xtranormal.com" target="_blank"> XtraNormal</a> &#8211; a text to video Web2.0 website (with downloadable Windows app linked to your account).</p>
<p>So, without further ado &#8211; Mr Gilchrist and Sam &#8220;do&#8221; the &#8220;Structure of the Atom&#8221;.</p>
<p style="text-align: center;"><a href="http://www.glengilchrist.co.uk/personalised-flipped-revision/"><img src="http://i.ytimg.com/vi/xelz4QXN8fQ/0.jpg" alt="YouTube Video"></a></p>
<p style="text-align: left;">Edit &#8211; one more</p>
<p style="text-align: center;"><a href="http://www.glengilchrist.co.uk/personalised-flipped-revision/"><img src="http://i.ytimg.com/vi/eMd35ewHuDE/0.jpg" alt="YouTube Video"></a></p>
<p style="text-align: left;">And more</p>
<p style="text-align: center;"><a href="http://www.glengilchrist.co.uk/personalised-flipped-revision/"><img src="http://i.ytimg.com/vi/P3oGWNgiffw/0.jpg" alt="YouTube Video"></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.glengilchrist.co.uk/personalised-flipped-revision/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using Webservice to pull data straight from the web into Excel</title>
		<link>http://www.glengilchrist.co.uk/using-webservice-to-pull-data-straight-from-the-web-into-excel/</link>
		<comments>http://www.glengilchrist.co.uk/using-webservice-to-pull-data-straight-from-the-web-into-excel/#comments</comments>
		<pubDate>Fri, 22 Mar 2013 10:31:25 +0000</pubDate>
		<dc:creator>Glen Gilchrist</dc:creator>
				<category><![CDATA[Excel]]></category>
		<category><![CDATA[ukedchat]]></category>

		<guid isPermaLink="false">http://www.glengilchrist.co.uk/?p=2052</guid>
		<description><![CDATA[
When I were a lad&#8230;.. we used to live in a Welsh village by the name of Raglan. &#160;My father used to insist that Raglan had the most expensive petrol for miles around &#8211; so we used to go on &#8220;outings&#8221; to the dizzy heights of Cwmbran to procure fuel and other essentials (plus Cwmbran had free parking &#8211; so ...]]></description>
				<content:encoded><![CDATA[<p style="text-align: center;"><a href="http://www.glengilchrist.co.uk/wp-content/uploads/2013/03/Using-webservice-to-get-data-from-web.jpg"><img class="aligncenter size-large wp-image-2053" style="border: 0px;" alt="Using webservice to get data from web" src="http://www.glengilchrist.co.uk/wp-content/uploads/2013/03/Using-webservice-to-get-data-from-web-700x420.jpg" width="700" height="420" /></a></p>
<p style="text-align: left;">When I were a lad&#8230;.. we used to live in a Welsh village by the name of Raglan. &nbsp;My father used to insist that Raglan had the most expensive petrol for miles around &#8211; so we used to go on &#8220;outings&#8221; to the dizzy heights of Cwmbran to procure fuel and other essentials (plus Cwmbran had free parking &#8211; so driving 15 miles to get free parking makes sense doesn&#8217;t it).</p>
<p style="text-align: left;">Anyway, a web site by the name of&nbsp;<a title="Petrol Prices" href="http://www.petrolprices.com" target="_blank">http://www.petrolprices.com</a>&nbsp;reports the price of petrol (either lowest, highest or average) in any town/city or postcode area in the UK.</p>
<p style="text-align: left;">You visit the site and enter a postcode / town and off you go.</p>
<p style="text-align: left;">But &#8211; wouldn&#8217;t it be great if we could pull this data straight into Excel for charting / analysis.&nbsp;</p>
<p style="text-align: left;">Excel 2013 has the new function of <strong>Webservice&nbsp;</strong>which does exactly that.</p>
<p style="text-align: left;"><strong>Back to&nbsp;&nbsp;<a title="Petrol Prices" href="http://www.petrolprices.com" target="_blank">http://www.petrolprices.com</a></strong></p>
<p style="text-align: left;">Before we understand how Excel Webservice works, let&#8217;s look at how&nbsp;&nbsp;<a title="Petrol Prices" href="http://www.petrolprices.com" target="_blank">http://www.petrolprices.com</a>&nbsp;produces its data. &nbsp;Instead of visiting the home page of PetrolPrices, cut and paste this url: &nbsp;</p>
<p style="text-align: left;">http://www.petrolprices.com/feeds/averages.xml?search_type=town&amp;search_value=abergavenny</p>
<p style="text-align: left;">Which is passing two search values (search_type=town &nbsp;and search_value=abbergavenny) to their database. &nbsp;The following page is displayed:</p>
<p style="text-align: center;"><a href="http://www.glengilchrist.co.uk/wp-content/uploads/2013/03/webfeed.jpg"><img class="aligncenter size-large wp-image-2056" style="border: 0px;" alt="XML Web feed" src="http://www.glengilchrist.co.uk/wp-content/uploads/2013/03/webfeed-700x419.jpg" width="700" height="419" /></a></p>
<p style="text-align: left;">Not very pretty &#8211; but you can decode what is being displayed, and can see that there is a structure to the data. &nbsp;</p>
<p style="text-align: left;">PetrolPrices</p>
<p style="text-align: left;">&#8212;&#8211;&gt; &nbsp;Fuel type Unleaded</p>
<p style="text-align: left;">&#8212;&#8212;&#8212;&#8212;&#8211;&gt; Highest</p>
<p style="text-align: left;">&#8212;&#8212;&#8212;&#8212;&#8211;&gt; Average</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8211;&gt; Lowest</p>
<p>&#8212;&#8211;&gt; &nbsp;Fuel type Diesel</p>
<p>&#8212;&#8211;&gt; &nbsp;Fuel type Super Unleaded</p>
<p>&#8212;&#8211;&gt; &nbsp;Link</p>
<p style="text-align: center;"><a href="http://www.glengilchrist.co.uk/wp-content/uploads/2013/03/Petrol.xlsx">Download Petrol Price Worksheet</a></p>
<p style="text-align: left;">Getting this data&nbsp;en masse&nbsp;into Excel is easy. Into a cell A1 &nbsp;type:</p>
<p style="text-align: left;"><strong>=WEBSERVICE(&#8220;http://www.petrolprices.com/feeds/averages.xml?search_type=town&amp;search_value=abergavenny&#8221;)</strong></p>
<p style="text-align: left;">Now A1 is full of the entire results of the search, in one cell &#8211; by itself not very useful</p>
<p style="text-align: left;">But, Exel can extract the information you want, by&nbsp;referring&nbsp;to the&nbsp;hierarchy&nbsp;of that data (as described above).</p>
<p style="text-align: left;">In cell A2 enter:</p>
<p style="text-align: left;"><strong>=FILTERXML(A1,&#8221;//PetrolPrices/Fuel[1]/Lowest&#8221;) &nbsp;</strong> &gt;&gt; which will display an answer of <strong>136.9</strong> (it might be different for you &#8211; as this is live data)</p>
<p style="text-align: left;">=FILTERXML() &nbsp;takes the data as imported and finds/extracts what you want.</p>
<p style="text-align: left;"><strong>//PetrolPrices/Fuel[1]/Lowest &nbsp;&#8211;&gt; </strong>navigates the&nbsp;hierarchy&nbsp;from PetrolPrices, to Fuel[1] (which in our case is Unleaded. &nbsp;Fuel[2] would be diesel and so on) to Lowest, which contains the data for the Lowest price.</p>
<p style="text-align: left;">Similarly: &nbsp;<strong>=FILTERXML(A1,&#8221;//PetrolPrices/Fuel[3]/Highest&#8221;)&nbsp;</strong>, would return the highest price for super unleaded petrol.</p>
<p style="text-align: left;">So now, if I store the location in a cell and add that to the WEBSERICE call: &nbsp;</p>
<p style="text-align: left;">=WEBSERVICE(&#8220;http://www.petrolprices.com/feeds/averages.xml?search_type=town&amp;search_value=&#8221;<strong>&amp;B1</strong>) &nbsp;(where &amp;B1 adds the value of B1 to the URL) &nbsp;I can create a spreadsheet where students can type in ANY town in the UK and get the price of petrol.</p>
<p style="text-align: left;">So&#8230;.</p>
<p style="text-align: left;"><a href="http://www.glengilchrist.co.uk/wp-content/uploads/2013/03/towns.png"><img class="aligncenter size-large wp-image-2057" alt="Interactive Town Petrol Price" src="http://www.glengilchrist.co.uk/wp-content/uploads/2013/03/towns-700x459.png" width="700" height="459" /></a></p>
<p style="text-align: left;">Whatcha know &#8211; my old man was right &#8212; Raglan does have the most expensive petrol for miles around &#8211; Cwmbran and the NP10 9JN post code (Morrisions) have the lowest priced fuel for miles around.</p>
<p style="text-align: left;">How could you use this service in class?</p>
<p style="text-align: center;"><a href="http://www.glengilchrist.co.uk/wp-content/uploads/2013/03/Petrol.xlsx">Download Petrol Price Worksheet</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.glengilchrist.co.uk/using-webservice-to-pull-data-straight-from-the-web-into-excel/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The startling link between FSM and Average Points Score (KS4)</title>
		<link>http://www.glengilchrist.co.uk/the-startling-link-between-fsm-and-average-points-score-ks4/</link>
		<comments>http://www.glengilchrist.co.uk/the-startling-link-between-fsm-and-average-points-score-ks4/#comments</comments>
		<pubDate>Wed, 20 Mar 2013 10:30:01 +0000</pubDate>
		<dc:creator>Glen Gilchrist</dc:creator>
				<category><![CDATA[Education]]></category>
		<category><![CDATA[Excel]]></category>
		<category><![CDATA[addcym]]></category>
		<category><![CDATA[ukedchat]]></category>

		<guid isPermaLink="false">http://www.glengilchrist.co.uk/?p=2044</guid>
		<description><![CDATA[I&#8217;m a data nut &#8211; I love numbers and visualising the relationship between often seemingly disparate sets of measurements. &#160; When the Welsh Government published MyLocalSchool&#160;the intention was for interested parties to be able to enter a school and see a snap shot of the metrics used to monitor said institution.
Like all teachers, I typed in my own school, those ...]]></description>
				<content:encoded><![CDATA[<p>I&#8217;m a data nut &#8211; I love numbers and visualising the relationship between often seemingly disparate sets of measurements. &nbsp; When the Welsh Government published <a title="My Local School" href="http://mylocalschool.wales.gov.uk/" target="_blank">MyLocalSchool</a>&nbsp;the intention was for interested parties to be able to enter a school and see a snap shot of the metrics used to monitor said institution.</p>
<p>Like all teachers, I typed in my own school, those around me &nbsp;and that to which I send my offspring. &nbsp;Great stuff.</p>
<p>But&nbsp;buried&nbsp;underneath the site is a wealth of data just waiting to be explored &#8211; as ALL primary and secondary schools in Wales are represented in the database, you just need to plug into the JSON code.</p>
<p><strong>Average KS4 Points vs Number on Role</strong></p>
<p>Are bigger schools better than small ones? &nbsp;Do the better schools attract more pupils, and hence the role goes up &#8211; do standards rise / fall?</p>
<p style="text-align: center;"><a href="http://www.glengilchrist.co.uk/wp-content/uploads/2013/03/average_role.jpg"><img class="aligncenter size-large wp-image-2045" style="border: 0px;" alt="Average Points vs Number of Role" src="http://www.glengilchrist.co.uk/wp-content/uploads/2013/03/average_role-700x467.jpg" width="700" height="467" /></a></p>
<p>What is clear from this plot is that, well, it&#8217;s not clear. &nbsp;The highest performing School (based on KS4 points) is also one of the smallest. &nbsp;BUT the 3 smallest schools also have the lowest Average Points.</p>
<p>&nbsp;</p>
<p><strong>Average KS4 Points vs Pupil Teacher Ratio</strong></p>
<p>Do schools with more teachers per pupil do better? &nbsp;Anecdotal&nbsp;thoughts would be &#8220;yes&#8221; &#8211; the more teachers the better.</p>
<p>This chart refutes this&nbsp;perceived&nbsp;wisdom &#8211; with schools with a PTR of 12 being amongst the highest performing, and those with a PTR of 19 being amongst the lowest.</p>
<p style="text-align: center;"><a href="http://www.glengilchrist.co.uk/wp-content/uploads/2013/03/average_ptr.jpg"><img class="aligncenter size-large wp-image-2046" style="border: 0px;" alt="Pupil teacher ratio vs average points" src="http://www.glengilchrist.co.uk/wp-content/uploads/2013/03/average_ptr-700x469.jpg" width="700" height="469" /></a></p>
<p>Now, I appreciate it&#8217;s all more confusing, confounding and generally mixed up than these two charts show &#8211; and clearly any conclusions based on them alone would be totally spurious &#8211; but look at this one:</p>
<p>&nbsp;</p>
<p><strong>Average KS4 Points vs Free School Meals</strong></p>
<p>As a fairly robust measure of poverty, schools record the Free School Meals that their pupils claim. &nbsp;Look at the FSM rate for all Wales and the impact that higher FSM has on the Average KS4 Points.</p>
<p style="text-align: center;"><a href="http://www.glengilchrist.co.uk/wp-content/uploads/2013/03/average_fsm.jpg"><img class="aligncenter size-large wp-image-2047" style="border: 0px;" alt="Average Points vs FSM" src="http://www.glengilchrist.co.uk/wp-content/uploads/2013/03/average_fsm-700x471.jpg" width="700" height="471" /></a></p>
<p>It&#8217;s good to know that our (Wales) National Priorities are Literacy, Numeracy and <strong>reducing the impact of poverty</strong> &#8211; and having spent a couple of hours with these data sets it&#8217;s been reinforced just how important poverty is in influencing the attainment of our young people.</p>
<p>&nbsp;</p>
<p><strong>Now, that leaves the question about what interventions do we put into place &#8211; &nbsp;hanging in the air doesn&#8217;t it.</strong></p>
<p>&nbsp;</p>
<p>(This was not a post on how I did the analysis &#8212; for those who are interested, I used a series of JSON calls to display the data for each school. &nbsp;Once you know a schools LEA number, you can import the JSON data directly into Excel)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.glengilchrist.co.uk/the-startling-link-between-fsm-and-average-points-score-ks4/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Change cell values by clicking (in the cell)</title>
		<link>http://www.glengilchrist.co.uk/change-cell-values-by-clicking-in-the-cell/</link>
		<comments>http://www.glengilchrist.co.uk/change-cell-values-by-clicking-in-the-cell/#comments</comments>
		<pubDate>Thu, 14 Mar 2013 16:13:19 +0000</pubDate>
		<dc:creator>Glen Gilchrist</dc:creator>
				<category><![CDATA[Excel]]></category>
		<category><![CDATA[ukedchat]]></category>

		<guid isPermaLink="false">http://www.glengilchrist.co.uk/?p=2039</guid>
		<description><![CDATA[If you run BTEC courses you will know that it can be death by marksheet &#8211; tracking 150+ learners over 6 modules and 20+ assignments takes the organisation skills of a small nation. &#160;I&#8217;m constantly looking for ways to reduce the impact of recording&#160;results&#160;BUT also a way to make sure only what you want gets recorded.
Excel has a great VBA ...]]></description>
				<content:encoded><![CDATA[<p>If you run BTEC courses you will know that it can be death by marksheet &#8211; tracking 150+ learners over 6 modules and 20+ assignments takes the organisation skills of a small nation. &nbsp;I&#8217;m constantly looking for ways to reduce the impact of recording&nbsp;results&nbsp;BUT also a way to make sure only what you want gets recorded.</p>
<p>Excel has a great VBA command<strong> &#8220;Worksheet_BeforeDoubleClick&#8221;&nbsp;</strong>which allows you to trigger events when the user double clicks into a cell.</p>
<p style="text-align: center;"><a href="http://www.glengilchrist.co.uk/wp-content/uploads/2013/03/changeonclick.xlsm">Download ChangeOnClick Workbook</a></p>
<p style="text-align: center;"><a href="http://www.glengilchrist.co.uk/wp-content/uploads/2013/03/changeonclick.jpg"><img class="aligncenter size-full wp-image-2040" style="border: 0px;" alt="Change cell values on double click" src="http://www.glengilchrist.co.uk/wp-content/uploads/2013/03/changeonclick.jpg" width="601" height="394" /></a></p>
<p style="text-align: center;">&nbsp;</p>
<p style="text-align: center;"><a href="http://www.glengilchrist.co.uk/wp-content/uploads/2013/03/vbaworksheet.jpg"><img class="aligncenter size-full wp-image-2041" style="border: 0px;" alt="vbaworksheet" src="http://www.glengilchrist.co.uk/wp-content/uploads/2013/03/vbaworksheet.jpg" width="280" height="174" /></a></p>
<p style="text-align: left;">Paste this code into the worksheet tab of the VBA Developer (not ThisWorkbook).</p>
<p style="text-align: left;">&nbsp;</p>
<p style="text-align: left;">
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="vb.net"><div class="devcodeoverflow"><ol><li><span style="color: #0000FF; font-weight: bold;">Option</span> Explicit</li><li>&nbsp;</li><li><span style="color: #0000FF; font-weight: bold;">Const</span> MYRANGE <span style="color: #0000FF; font-weight: bold;">As</span> <span style="color: #6a5acd;">String</span> <span style="color: #000000;">=</span> <span style="color: #a52a2a; back-color: #fffacd;">&quot;B2:J30&quot;</span></li><li>&nbsp;</li><li><span style="color: #0000FF; font-weight: bold;">Private</span> <span style="color: #0000FF; font-weight: bold;">Sub</span> Worksheet_BeforeDoubleClick<span style="color: #000000;">&#40;</span><span style="color: #0000FF; font-weight: bold;">ByVal</span> Target <span style="color: #0000FF; font-weight: bold;">As</span> Range, Cancel <span style="color: #0000FF; font-weight: bold;">As</span> <span style="color: #6a5acd;">Boolean</span><span style="color: #000000;">&#41;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000FF; font-weight: bold;">If</span> Target<span style="color: #000000;">.</span><span style="color: #000000;">Cells</span><span style="color: #000000;">.</span><span style="color: #000000;">Count</span> <span style="color: #000000;">&gt;</span> <span style="color: #a52a2a; back-color: #fffacd;">1</span> <span style="color: #0000FF; font-weight: bold;">Then</span> <span style="color: #0000FF; font-weight: bold;">Exit</span> <span style="color: #0000FF; font-weight: bold;">Sub</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000FF; font-weight: bold;">If</span> Intersect<span style="color: #000000;">&#40;</span>Target, <span style="color: #0000FF; font-weight: bold;">Me</span><span style="color: #000000;">.</span><span style="color: #000000;">Range</span><span style="color: #000000;">&#40;</span>MYRANGE<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> <span style="color: #0000FF; font-weight: bold;">Is</span> <span style="color: #0000FF; font-weight: bold;">Nothing</span> <span style="color: #0000FF; font-weight: bold;">Then</span> <span style="color: #0000FF; font-weight: bold;">Exit</span> <span style="color: #0000FF; font-weight: bold;">Sub</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;Cancel <span style="color: #000000;">=</span> <span style="color: #0000FF; font-weight: bold;">True</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000FF; font-weight: bold;">Select</span> <span style="color: #0000FF; font-weight: bold;">Case</span> Target<span style="color: #000000;">.</span><span style="color: #000000;">Value</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000FF; font-weight: bold;">Case</span> <span style="color: #a52a2a; back-color: #fffacd;">&quot;&quot;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Target<span style="color: #000000;">.</span><span style="color: #000000;">Value</span> <span style="color: #000000;">=</span> <span style="color: #a52a2a; back-color: #fffacd;">&quot;P&quot;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000FF; font-weight: bold;">Case</span> <span style="color: #a52a2a; back-color: #fffacd;">&quot;P&quot;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Target<span style="color: #000000;">.</span><span style="color: #000000;">Value</span> <span style="color: #000000;">=</span> <span style="color: #a52a2a; back-color: #fffacd;">&quot;M&quot;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000FF; font-weight: bold;">Case</span> <span style="color: #a52a2a; back-color: #fffacd;">&quot;M&quot;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Target<span style="color: #000000;">.</span><span style="color: #000000;">Value</span> <span style="color: #000000;">=</span> <span style="color: #a52a2a; back-color: #fffacd;">&quot;D&quot;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000FF; font-weight: bold;">Case</span> <span style="color: #a52a2a; back-color: #fffacd;">&quot;D&quot;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Target<span style="color: #000000;">.</span><span style="color: #000000;">Value</span> <span style="color: #000000;">=</span> <span style="color: #a52a2a; back-color: #fffacd;">&quot;&quot;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000FF; font-weight: bold;">End</span> <span style="color: #0000FF; font-weight: bold;">Select</span></li><li>&nbsp;</li><li><span style="color: #0000FF; font-weight: bold;">End</span> <span style="color: #0000FF; font-weight: bold;">Sub</span></li></ol></div></pre><!--END_DEVFMTCODE--></p>
<p>&nbsp;</p>
<p>Now when you double click in cells in the range B2:J30, the contents cycle through P, M, D and &#8221; &#8221; (blank).</p>
<p>You can easily alter the RANGE that this macro applies to, and the text that cycles round can also be&nbsp;amended&nbsp;/ added to.</p>
<p>&nbsp;</p>
<p>A splendiferous way to limit user input.</p>
<p>&nbsp;</p>
<p style="text-align: center;"><a href="http://www.glengilchrist.co.uk/wp-content/uploads/2013/03/changeonclick.xlsm">Download ChangeOnClick Workbook</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.glengilchrist.co.uk/change-cell-values-by-clicking-in-the-cell/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Use Excel to speak the contents of a cell</title>
		<link>http://www.glengilchrist.co.uk/use-excel-to-speak-the-contents-of-a-cell/</link>
		<comments>http://www.glengilchrist.co.uk/use-excel-to-speak-the-contents-of-a-cell/#comments</comments>
		<pubDate>Wed, 13 Mar 2013 17:05:26 +0000</pubDate>
		<dc:creator>Glen Gilchrist</dc:creator>
				<category><![CDATA[Excel]]></category>
		<category><![CDATA[ukedchat]]></category>

		<guid isPermaLink="false">http://www.glengilchrist.co.uk/?p=2021</guid>
		<description><![CDATA[You know the oft repeated phrase &#8220;90% of Excel users only use 10% of the functionality&#8221; (or numbers to that effect). &#160;Well I came across a feature today that I sort of, deep down knew would be possible &#8211; but had just never used before.
Text to Speech Conversion
Long gone are the days of a dalek like rendition of &#8220;H E ...]]></description>
				<content:encoded><![CDATA[<p>You know the oft repeated phrase &#8220;90% of Excel users only use 10% of the functionality&#8221; (or numbers to that effect). &nbsp;Well I came across a feature today that I sort of, deep down knew would be possible &#8211; but had just never used before.</p>
<p><strong>Text to Speech Conversion</strong></p>
<p>Long gone are the days of a dalek like rendition of &#8220;H E L L O &nbsp; &nbsp; D A V E&#8221; &nbsp;- PC&#8217;s can now communicate in a&nbsp;relatively&nbsp;human like manner. &nbsp;And certainly Windows XP upwards has had fairly&nbsp;usable&nbsp;text-speech conversion.</p>
<p>But&#8230;. Excel manages to hide this function well. &nbsp;You need to create a custom menu on the ribbon and add the tools to it.</p>
<p>I&#8217;m using Excel 2013 &#8211; but the procedure is similar for any Excel 2004+.</p>
<ol>
<li>Right Click on the ribbon and choose customise</li>
<li>Change the Choose commands from to select <strong>All Commands</strong></li>
<li>Scroll down to S, and find the Speak Cells option</li>
<li>Add this option to the ribbon.</li>
</ol>
<p>(You will need to create a New Group first, using the button on the right hand side. &nbsp;I added mine to the HOME Tab, so that it was easily accessible)</p>
<p style="text-align: center;"><a href="http://www.glengilchrist.co.uk/wp-content/uploads/2013/03/Texttospeach.xlsx">Download Text to Speech Workbook</a></p>
<p style="text-align: center;"><a href="http://www.glengilchrist.co.uk/wp-content/uploads/2013/03/speakcellsmenu.jpg"><img class="aligncenter size-large wp-image-2022" style="border: 0px;" alt="Add Speak Cells to Excel ribbon" src="http://www.glengilchrist.co.uk/wp-content/uploads/2013/03/speakcellsmenu-700x572.jpg" width="700" height="572" /></a></p>
<p style="text-align: center;"><a href="http://www.glengilchrist.co.uk/wp-content/uploads/2013/03/new-group.jpg"><img class="aligncenter size-full wp-image-2023" style="border: 0px;" alt="Create group on ribbon Excel" src="http://www.glengilchrist.co.uk/wp-content/uploads/2013/03/new-group.jpg" width="426" height="314" /></a></p>
<p>Once the group is created and the<strong> Speak Cells</strong> option has been added, you could also add <strong>By Columns</strong>, <strong>By Rows</strong>, <strong>Stop Speaking</strong> and <strong>On Enter</strong>.</p>
<p>By default, Excel will speak the contents of the active cell, when the Speak Cell button is pressed. &nbsp;Select By Rows and Excel will speak an entire selection, going across the rows first (conversely&nbsp;By Columns will speak an entire selection, but going down the column first).</p>
<p>Stop Speaking &#8211; inturrupts the voice</p>
<p>On Enter toggles Excel speaking everything that you type, once you press Enter.</p>
<p style="text-align: center;"><a href="http://www.glengilchrist.co.uk/wp-content/uploads/2013/03/speak-cells.jpg"><img class="size-full wp-image-2026 aligncenter" style="border: 0px;" alt="speak cells menu" src="http://www.glengilchrist.co.uk/wp-content/uploads/2013/03/speak-cells.jpg" width="179" height="147" /></a></p>
<p><strong>Uses</strong></p>
<ol>
<li><span style="line-height: 13px;">Use to validate data as you enter it</span></li>
<li>Use to read out a list of data for students to&nbsp;manipulate</li>
<li>Use (with By Rows) to get Excel to create a&nbsp;sentence. &nbsp;A1=Calculate B1 = 52 C1 = take away D1 32 &nbsp;&#8211; highlight the row and off you go:</li>
</ol>
<p style="text-align: center;"><a href="http://www.glengilchrist.co.uk/wp-content/uploads/2013/03/sums.png"><img class="aligncenter size-full wp-image-2024" style="border: 0px;" alt="Using text to speak for sums" src="http://www.glengilchrist.co.uk/wp-content/uploads/2013/03/sums.png" width="577" height="345" /></a></p>
<p style="text-align: center;">Highlight from Calculate to the end of &#8230;&#8230;. (include the &#8230;. as these provide additional thinking time &#8211; ie silence)</p>
<p style="text-align: center;"><a href="http://www.glengilchrist.co.uk/wp-content/uploads/2013/03/Texttospeach.xlsx">Download Text to Speech Workbook</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.glengilchrist.co.uk/use-excel-to-speak-the-contents-of-a-cell/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using disk: enhanced

 Served from: www.glengilchrist.co.uk @ 2013-05-23 02:57:10 by W3 Total Cache -->