R – Using Excel to display the number of occurrences within a date range

excelhistogrampivot tablestatistics

I've got a list of transaction dates and the user id of the person who made the transaction on that date (just 1 Tx/day allowed). For example:

I'd like to create a matrix which shows, as of each date, the number of users who have made 1 transaction, 2-10 transactions, 10-20 transactions, etc. For example (note, the below data doesn't correspond to the transaction data above):

Is a pivot table my best mechanism here? If so (or not) how would I approach this?

Best Answer

My vote use a pivot If you have 2007 something like this

1) Select the data you have above 2) Do Insert Pivot 3) Drag Date to Row Loabel 4) Drag User ID to Columns => you get one column per user ID 5) In Values yoiu should have Count of Users 6) Then you need to add new columns that calculates the number of users that are in segment 1-10 etc