Data Handling and Google Maps

Part 2 – The Hard Bit (Handling the Data)

In part 1 I very deliberately glossed over the work required to make sense of the data presented by the Google App and how it worked inside Excel.       

The value for handling the data from this app depends on the age group and ICT expectations of your pupils.       

If you’re looking at this as a GCSE IT project, then ask your pupils to code the sheet with a VB macro and please can I have a copy?       

If – more likely – you’re looking at this and saying ‘I don’t care how awkward the data is that you start with – please give it to me so I can easily use in a spreadsheet and make a graph without too much effort’ – then read on.       

What you should have at the end of this post is a working spreadsheet you can use again and again and (hopefully) an understanding of some of the powerful string manipulation tools in Excel. I’m using 2007 but I think most of the ideas shown work in Excel 2003 and probably OpenOffice.   

    

Start at the very beginning       

The info in notepad

This was the data presented to us from the Google App – we could simply say – the 1st line contains the height at the start, the 2nd line the distance to first point, etc. So – just copy and paste it – job done move on to the spreadsheeting and graphing stuff.       

But we don’t want to do it like that!

We want to make it complicated (ish).Let’s see what Excel can take apart – so what do we have going in?      

The distance is found starting 2 spaces after the W. So use Search to find the W     

F2 formula shown

Our number starts 2 spaces beyond there – consistently (that’s the key word) – so let’s record that.     

Formula for cell G2

The end of our number is 2 spaces from the right hand side of the whole length of the string.     

Formula for cell H2

Now – lets use the info we know and extract the actual number with the mid function     

Formula for cell I2

Et voila! The height! (I don’t know the French for that :( )     

Now -  let’s use a similar trick to find the distance. Notice that the app presents the leg distance (1.8km) and the rounded total (4). The totals are actually no use for this task. We’re looking for the letters km and the degree sign and we’ll pull the distance in a similar fashion to the height..     

Formula for F3Formula G3

Now – ignore column H – that will put all our results in column I.

Formula I3

In order to get the screen grabs above I used the hide feature on rows 1 and 2. To unhide the first rows (or columns) in a sheet is a bit numb – and unfortunately I can’t get a screen grab – but move the cursor to the row header (that’s the label in the row) – then when the cursor changes to a small parallel – I’ll try to get a video sorted! So – now we have one column that – reading down shows -
height    

leg distance
height    

leg distance
height    

So we need the first leg distance to be zero – cell I1 is a blank – that’ll do. So now we have it so that cells I1 and I2 then I3 and I4 etc have the info we need.    

We would like our data in a continuous block, rather than with spare lines. So, in the columns dropping down from cells j2 and k2 calculates the cell references for the cells with the data.    

Making labels

The formula for cell j2 gives us the cell label for the height

'nother label

The formula for cell k2 gives us the label for the distance
Copy the cells j2 and k2 down as far as you need
 
How to use the cell labels – the rarely used indirect
Indirect says – look in the cell specified – then give me the value from that cell reference – a cool tool!

A useful tool..

So with L2 selected – we can see that we are looking back indirectly for our data. Copy L2 to M2 then drag them down .. now we have the block we need – contiguous (not a spelling mistake).
If you look at the list you’ll see 114 0 114 – I did a figure 8 and recorded 2 seperate sessions with the Google app. We’ll panic about this one shortly.
 
Here’s the scenario – I’d like to use a multi worksheet workbook, where the first worksheet is the main info page. the second page is the route (that is the data about which we will record data) – and I’ll record the times in sheets 3 onwards are going to be the places where I record the times.
Make the results sheet
At the bottom of the sheet, right click the sheet tab – currently showing Sheet1 and select rename on the menu. Rename it to routedata.
Rightclick it again and click insert – then select worksheet.
This ‘should’ put you a new sheet to the left called Sheet1 – right click this and rename to output

Sheet music

Then rename the other sheet to results1 (no spaces between the words).    

The Home Run (kind of!)    

In the ‘output sheet’ we’ll link to the ‘routedata’ and the results sheets. It’s the links to te routedata that will allow us to ignore the stop and restart.    

In ‘output’ go to cell B2 (we’ll use column A for point names and row 1 for headings) and type = then skip to the ‘routedata’ sheet, click in cell L2 and click the enter key.    

Linking across sheets

If you copy b2 to c2 then drag-copy b2:c2 downwards you’ll see we get this problem.    

Trouble at t'mill

Simply copy down to the last good cell, then start again from the restart (cell b7). Then in column 1 enter the point names on your run – the across row 1 put in the headings you’re interested in.
 
So – from here ..

Nearly there..

We now go to the results tab and enter the individual data – start by simply referring to the output locations in the results sheet – like so -
 
 Then simply drag the formula down, then enter the dates in the first row, and the times below – remember to put zero for the start!

The embarrasing bit!

Now to make some pretty pictures.
What do we want to see with the data? How about the detail for any one run and a running summary of the effect of the times on a half marathon (20km) forecast?
The ascii code for A is 65 – so the char() result for 65 is A
So if we use an entry number request for a run number, validate it then add it to A – we’ll get our column required.
So – bit more ambitious on the code here – here’s D2 (we’ll hide this column later)

Now it's getting complicated

And pop into column e and use the indirect again -

Formula shown for e2

Let’s add some extra headings, do a bit of tidying up, then (as they said on t’other side of the pond) ‘do the math’.

tidying up

Tidied up (sort of)

The cumulative distance is the made up as follows -
the equation for cell F3 is =F2+C3
the equation for cell F4 is = F3+C4 etc..
Make sure you leave cell G2 and H2 blank – the results amy be as good as this if you don’t.
Average minutes per leg is the leg time/leg distance
Target half marathon time is (21.1/cumulative dist)*time
Then slect all column F G and H and force it to 1 decimal place – otherwise you may find you’re trying to improve on that final microsecond.

Bit of common sense called for here

And just do a bit of tidying up – eg centring the data and hide column D (Don’t delete it!)
Now – graph the math .. that’s going to be part 3!!