#31: Easy and Excel-lent Data sources

clip_image002

Most people who have spent time using Microsoft Excel will realize that it probably has more capabilities than they’ll ever understand, much less use. There are so many functions used to collate, display and interpret data that it’s no wonder people turn to using it for all sorts of things.

There have been numerous attempts to make user-friendly data tools for Excel, from web-scraping 3rd party sites to the short-lived Money in Excel for American users which bit the dust before it was barely out of diapers.

More recent releases of Excel include several Linked Data Types which can retrieve and manipulate data from “reputable sources of data, such as Bing”… (which, incidentally, had its 15th birthday recently). Companies with suitable data governance can expose internal info for analysis, or regular end users can get started with share prices, currency conversions and geographical data.

clip_image004

In the Data tab in the current versions of Excel on multiple platforms, you’ll see 3 or 4 types of data that can quickly be inserted – they will perform a lookup on external information and return a data set in the background which can be displayed and otherwise interacted with using formulae, lookups and other standard data tools in Excel.

clip_image006

Getting real-time data is pretty straightforward – create a blank table with a single column in which you’ll enter your key data items that you want to expand on – for currency conversions, it would be a pair of currency symbols (USD:EUR or GBP/USD etc) that you then select and mark as Currency from the data tab. That then lets you easily add other columns for specific lookup data, and that can be referenced itself through other formulae too.

clip_image007

Stock lookups work similarly, by entering the ticker symbol in one column and potentially going through a matching exercise to find the right one. Handy, if you have a workbook for calculating when you can stick it to the man and retire to a patch in the Tuscany hills: you can automatically look up the stock values and convert their currencies too, if required.

clip_image009

There’s some location stuff as well, invoked by entering city or area names; it’s more text-based reference info which is returned, though it might be possible to feed some of the data into a Map Chart for further visualization.

630 – slimming your PPT

Piles of documentsPowerPoint files can get big. In the scale of small vs large, sending a many-megabyte PPT file around between a few people might not matter much, but if you’re building a presentation that is going to be widely shared, it could cost actual money – data storage costs, bandwidth charges on a website, carbon footprint for transmitting and storing etc.

Estimates of the energy cost to transmit and store data vary wildly, but if 1 GB cost 1 kWh power and the average CO2 output for generation was ~500g/kWh, then even shaving 10MB off a file can make a material difference if it’s going to be heavily used.

There are a few tricks you can follow to make your PPTs less massive – like compressing the images within, meaning that an embedded picture which was originally sized to print on a poster could be re-sized to fit on a screen.

File sizes sortedIf you see a few-slide presentation file and it’s dozens of MB in size, then there’s probably other info in the deck which is not necessary for your presentation. Even more likely is that there are some embedded graphic or video assets which are bloating the size of it. Quickly identifying the cause of such largesse might allow you to ditch the offending slide or resize/remove the content.

A somewhat cavalier way of looking for large things you can torch, is to make a copy of your PPTX file and then rename it so you can look within. The OfficeXML file formats (prevalent in Office 2007 and onwards) use the same compression as ZIP files, so if you rename your file as such, you’ll be able to open it in Windows Explorer or other ZIP handling utilities, to see its innards. Opening the file shows you a folder structure, and if you navigate into ppt \ media then sort by Size, you’ll quickly see what’s making your file so big.

File Name extensions optionActually doing the rename might be trickier than you think, since Windows hides by default such grubby detail as file extensions. One trick is to flip the switch to show extensions again (in Windows Explorer, look under View menu / Show / File name extensions), then it’s a simple matter of changing the file in Explorer by editing the last part of its name from .pptx to .zip.

Renaming file in ExplorerOnce you’ve confirmed in the warning dialog that the apocalypse is nigh and you really do want to change file type, open the new ZIP file and you’re off. Remember to go back in and switch off the Show > File name extensions option if you’re so inclined.

Renaming file, command lineIf you’re still unsure about these new-fangled “gooey” interfaces, you could crack open the command line to do it quickly.

Slide master viewIf all this grubbing about inside PowerPoint files makes you feel uneasy, there is one other trick that could yield dividends – look inside the Master. Since many people create a new presentation by starting with an old one, they liked, it’s very possible there are slide layout templates with embedded graphics that you no longer need – especially if the originating deck was produced for a conference.

Go into View menu and look under Slide Master, which will open a whole new tab specific to the management of these template slides that form the bones of the presentation. You may well see lots of title slides or similar, which have embedded background images – if you know you don’t need those graphics or those layouts, just delete them.

Closing Master viewPowerPoint generally won’t let you ditch a master layout which is being used to format the current slide deck; so, if you have your deck already built and want to distribute it, just go into the Slide Master view, delete everything which looks unnecessary and that PowerPoint will allow you to, then Close the Master view to return to the main menu. Once you’ve checked that the presentation format hasn’t been garbled, go File > Save As and give it a new name. Now compare the size of the new and old files.

Super Massive background graphic

This title slide in the Slide Master view had a graphical background which was 17Mb in sizefile sizes compared; just deleting all the unnecessary visual slide templates dropped the size of the original file from 110MB to 26MB.

Compress pictures dialogRunning the Document Inspector to remove other content further dropped another 1.5MB.

Selecting an image from one of the 70-odd slides in the deck, and choosing Compress Pictures from the Picture Format tab reduced it again to only 11MB, or 10% of the original file size – all for a few minutes’ effort.

Tools from Save As dialogGoing back to the original 110MB file and opening File > Save As, then choosing More options… will open a traditional Save As dialog box; on the bottom is a Tools > submenu which allows you to run the Compress Pictures function at the point of saving the file, so reducing it to 1/3 of the original size, for literally 15 seconds’ work.More options of Save as dialog

NB: the irony of sending a 2MB email to thousands of people, and sharing online and on LinkedIn, is not lost.

597 – Pivot table filtering

clip_image002Pivot Tables are a somewhat esoteric spreadsheet feature which everyday Excel users probably shy away from, but for the enlightened can help to turn potentially large tables of raw data into summarised views that can be easily rearranged.

Excel makes it easy to take a static table with rows of data arranged into columns that correspond to measures or fields – like sales of a product, or assignments of a relationship such as an export from a CRM system – and then represent the inherent hierarchy in a super-powerful fashion.

If you haven’t really used Pivot Tables, the simplest way to get your head around what they can do is to try messing around with some real data, or use some relatively simple sample data to unearth the power within. Free sample data at Contextures is a good place to start – in fact, here’s one sample that has been turned into a Pivot table to get started with (just download it somewhere, open the Zip file and then open the example XLSX file within).

clip_image004The sample data is sales of foods over a period of time; look at the FoodSales tab to see the raw data. The pivot table quickly lets you summarise by region, or category, or whatever fields are defined.

By showing the PivotTable field list (right-click on the table and you’ll see either show or hide field list at the bottom of the menu), you can easily drag things around to change the grouping order.

clip_image006It’s easier to just try it out than to try and explain, though there are plenty of tutorials around – from overviews to walkthrough videos or all kinds of more advanced stuff. And if you end up making a mess of the table, there’s also CTRL+Z to undo…

clip_image008If you’re dealing with lots of fields that would go in the Rows section then you might find it easier to use the Classic layout by right-clicking on the table and choosing Pivot Table options, though you might want to remove the auto-totalling for most of the fields (right-click on a field and choose Subtotal…) otherwise the display gets a bit unwieldy.

clip_image010When handling very large volumes of data, filtering using the drop-downs to the right side of field names is a great way of showing only the specifics you’re interested in, though sometimes it’s easy to forget there’s a filter in force and think that the data you’re working with is not showing the full picture. To reset all the filters back to the start, just go to the Data tab and Clear the filters from there.

clip_image012If you want to filter on a specific value – eg. Let’s say you have a list of customer account names and you want to show only the customers associated to a single account manager (regardless of geography, industry etc), you could click the filter on the account manager field and find the person’s name within.

In our foodstuff example, we could have a different layout of fields and want to filter on City – but a quicker way to doing so is to just right-click on the name you want to focus on, and choose Filter > Keep Only Selected Items and it will quickly set the filter to just that name.

Tip o’ the Week 485 – Excel and the Web

clip_image002For decades, it’s been possible to import data into spreadsheets from elsewhere. Excel supports many data sources, from basic stuff like CSV, ODBC and OLE DB, to more specific and advanced knowledge of particular data sources and types.

A recent tweet from @msexcel showed a simple video  on how to grab data from a website – highlighting a capability that’s been in Excel for years but has been refreshed and made a lot easier to use.
Try this as an example:

  • clip_image004In a new Excel workbook, go to the Data tab and choose From Web
  • Try a web site that has data tables – eg
    https://en.wikipedia.org/wiki/World_population
  • clip_image006After confirming the authentication method to connect, Excel will retrieve the page and try to make sense of its layout – and let you choose the table you want to retrieve data from.
    This is part of a new “Get & Transform Data” set of functionality that’s available to Office 365 subscribers, that uses Power Query to retrieve data from a variety of sources, and can include some advanced transformation and editing of the query too. See here for a more detailed tutorial.

clip_image008If you want to revert to using the old data import methods, you can either enable the Legacy import wizards in Options (File > Options > Data > Show legacy data import wizards), or just type Legacy into the Search / Tell Me box in Excel, and see the available actions from there.
You can jump to the Search box quickly by pressing ALT+Q and jump straight to any Excel function, or get help on how to do many tasks.

clip_image010Another cool Office 365 data feature is to use Data clip_image012Types. Enter your data in a column, select it and choose the appropriate Data Type – let’s use Stocks as an example.

Once you’ve tagged the source data, clicking on the icon to the left of the data point will show a pop up with the background detail, or you can reference the fields within formulae to display or manipulate the data values.

clip_image014Each data source presents a number of fields that can be discovered and selected through autocomplete in a formula, and the values can be refreshed easily.

See more detail on using the Stock quotes functionality, here.