Download Raw/Formatted Data

Use this table to download 1) all of the raw data aggregated from the State Board of Elections (flat file); 2) a statewide csv file of all races formatted for use (flat file); and 3) a sample Microsoft Access database that uses the full statewide formatted file and also has some query examples that demonstrate how the data can be used.

If you are looking to do your own analysis and want to use the raw data then one of these three data sets should give you what you need to get started.

A more thorough explanation of data formatting and use can be found below the table.


Year Election Type Description
2014 General Raw Data Files All of the raw data aggregated from the State Board of Elections by county/election authority (flat file)
2014 General Statewide CSV File A single statewide csv file of all races formatted for use (flat file)
2014 General MS Access Database Example A sample Microsoft Access database that uses the full statewide formatted file plus has some query examples that demonstrate how the data can be used
2016 Primary Raw Data Files All of the raw data aggregated from the State Board of Elections by county/election authority (flat file)
2016 Primary Statewide CSV File A single statewide csv file of all races formatted for use (flat file)
2016 General Raw Data Files All of the raw data aggregated from the State Board of Elections by county/election authority (flat file)
2016 General Statewide CSV File A single statewide csv file of all races formatted for use (flat file)


Formatting the Data

First I went to the State Board of Elections and downloaded each of the data files available and copied them into their own spreadsheet. Also I added three columns 1) Election (i.e. "2014 General"), 2) County and 3) Subpart (i.e. "Chicago Only" or "Cook Only" or "All").

When you look at the data you will notice that it is a flat file, meaning each value has its own row. In order to aggregate the data into the typical table format that you are used to you will either have to write some code to do so or to use a tool (like Microsoft Access crosstab query) to do so.

Next I aggregated all of these files provided by the SBE into one large file. This file is more than the Excel row limit so you cannot open the full statewide CSV file in Excel but you should be able to open it in any text editor and most database programs.

One problem with using files provided by 110 different election authorities is that while they use (mostly) unique identifiers for race, candidate and party the naming convention varies from county to county. For example for the US Senate race one county might list it as "U.S. Senate" while another has "US Senate" while another has "US Senator", and so on. Long story short I went through every race, candidate and party and edited them for consistency.

Once all of that was done I exported that data into the Statewide CSV File that is available for download above.

Last, using this data file in Microsoft Access I created some crosstab queries to demonstrate how this file can be used to produce tabular results by precinct and by county for each of the statewide races. With a little bit more than a beginner's understanding of Microsoft Access you should be able to produce the same type of output for any of the races that you're interested in.

The database engine used to power the data displayed on this site isn't Access it's mySQL so what I have is a little more complicated but if you are looking to do your own analysis and want to use the raw data then one of these three data sets should give you what you need to get started.