Line Graph with Date on X axis and occurrence on X axis
Hmm, you could do a pivot with this data, or insert a column which will have the number of occurrences of each date.
Pivot table
- Be sure to have a column name and then do a PivotTable on the field D (Go to "Insert" > "PivotTable" > Select your data and then "OK").
Drag the field into "Row Labels" and "Values" both.
You can then insert a line graph from the pivot table itself.
Adding a new column
Add a column to the right of the dates containing the formula (I assume that D1 contains the column name and that the data starts in cell D2):
=COUNTIF(D:D,D2)
Name the column (e.g. Number of access requests) and insert a line graph based on the two columns.
If this data will need to be updated on a regular basis, a Pivot Table fed by a Table is the way to go.
- Convert your data into a Table (Insert>Table). This will update whenever you add data. Also, if your data is coming from an ODBC compliant source (e.g. SQL Server), you can have it automatically update with current data.
- Add a column to your Table, called Count. Then enter the formula
=1
. This will automatically fill a 1 in for every value in your Table. - Create a Pivot Table (Insert>Pivot Table) using your Table as a data source.
- Format your Pivot Table like this (it will be similar to Jerry's Pivot Table):
- Row Labels = Date
- Values = Count
- With your Pivot Table highlighted, create a Line Chart (Insert>Line). This will create a Pivot Chart which will automatically update with your Pivot Table.
When you're done with this setup, everytime you add a value to your primary data Table, you can refresh your Pivot Table and the associated Pivot Chart will also update.
I think what you need is a step line chart based on your description. To draw this kind of chart, I propose you to use the free Funfun Excel add-in, which allows you to use JavaScript code directly in Excel. The step line chart would be easy to draw using JavaScript. Here is an example that I drew based on your sample data.
Basically, the Funfun Excel add-in enables you to use JavaScript to process the data you stored in the spreadsheet. That being said, you could use libraries like HighCharts.js or D3.js to draw charts. In this example, I used HighCharts.js. For your sample data, there is not always logins for each day. If you don't give a data (0 logins) for dates that without logs, you line will not show correctly. What I did in here is to create an array with all the dates in the month, each date will have a default 0 logins. Then based on your logs in the spreadsheet, I compare their date with the pre-created array and add logins into the array. Here is some code.
var dayFirst,
monthFirst,
dayLast,
monthLast;
dayFirst = parseInt(data[1].split('/')[0]);
monthFirst = parseInt(data[1].split('/')[1]) - 1;
dayLast = parseInt(data[data.length-1].split('/')[0]);
monthLast = parseInt(data[data.length-1].split('/')[1]) - 1;
for(var i=monthFirst;i<=monthLast;i++ ){
for(var j=dayFirst;j<=dayLast;j++){
logins.push(
[Date.UTC(2017, i, j),0]
);
}
}
for(var i=1;i<data.length;i++){
var dateThis = data[i];
var year = parseInt(dateThis.split('/')[2]);
var month = parseInt(dateThis.split('/')[1]-1);
var day = parseInt(dateThis.split('/')[0]);
for(var j =0;j<logins.length;j++){
if(logins[j][0]==Date.UTC(year, month, day)){
logins[j][1] += 1;
}
}
}
The Funfun also has an online editor in which you could explore your JavaScript code and result. You could check the detail of how I made the example chart in the link below.
https://www.funfun.io/1/#/edit/5a4e571b1010eb73fe125cd9
Once you are satisfied with the result you achieved in the online editor, you could easily load the result into your Excel using the URL above. But of course, first, you need to add the Funfun add-in into your Excel by Insert - Office Add-ins. Here are some screenshots showing how you load the example into you Excel.
Disclosure: I'm a developer of Funfun