Count and order (from A-Z) number of recurring text strings

zgoldflo

New Member
Joined
Dec 13, 2021
Messages
30
Office Version
  1. 365
Platform
  1. Windows
Hi folks.

Working with a (trimmed) dataset with over 25,000 rows of data.

Objective: Determine the top 100 most common route_taken for each user_type (only two user_type i.e. casual & member).
Details: Over 6,980 number_unique_routes.

Explanation: Trying to figure out either by using a pivot_table (tried but really don't know how to input data correctly) or by using a function/formula how to retrieve the most common routes taken for members and casual users. Would like to first understand how to apply the formula/function to retrieve the most common routes how many times they appear ordered by Z-A (to retrieve the top 100 rows of data). Not sure how to implement the =COUNTIF function in this scenario to count recurring text strings and how I can apply it. An explanation would really wrap my mind around it, thanks in advance (@Joe4 any ideas?).

e.g. something like this maybe? (open to suggestions on better ways to structure this)
*Note
with some route_taken you might get an instance where both members and casual riders use that route but members or casual riders could be the more common user. (See frequent_rider_route columns)

1639539967859.png


I think I made my problem quite clear - if any clarification is needed, please let me know!

See below MiniSheet


December_2020_trimmed_v2.csv
ABCDEFGHIJKLMNO
1ride_iduser_typerideable_typeday_of_weekstarted_atended_atride_lengthstart_station_nameend_station_nameroute_takenstart_station_idend_station_idstart_coordinatesend_coordinatesdistance_traveled_miles
28AC7643FDA05E1D4memberclassic_bike32020-12-08T05:41:00Z2020-12-08T06:21:00Z0:40:05Larrabee St & North AveHalsted St & Clybourn AveLarrabee St & North Ave to Halsted St & Clybourn AveTA130600000833141.91021, -87.643541.909668, -87.6481280.24089942
322B721668F54DF09memberclassic_bike42020-12-09T05:55:00Z2020-12-09T06:17:00Z0:21:56Larrabee St & North AveHalsted St & Clybourn AveLarrabee St & North Ave to Halsted St & Clybourn AveTA130600000833141.91021, -87.643541.909668, -87.6481280.24089942
40AE1B9DB2F1F8BC2memberclassic_bike12020-12-13T12:00:00Z2020-12-13T12:03:00Z0:03:03Larrabee St & North AveHalsted St & Clybourn AveLarrabee St & North Ave to Halsted St & Clybourn AveTA130600000833141.91021, -87.643541.909668, -87.6481280.24089942
58DAEDE1893BCCBC8memberclassic_bike62020-12-18T11:57:00Z2020-12-18T12:00:00Z0:03:00Larrabee St & North AveHalsted St & Clybourn AveLarrabee St & North Ave to Halsted St & Clybourn AveTA130600000833141.91021, -87.643541.909668, -87.6481280.24089942
6EEC33E416B277B7Acasualclassic_bike12020-12-20T18:47:00Z2020-12-20T19:00:00Z0:13:05Larrabee St & North AveHalsted St & Clybourn AveLarrabee St & North Ave to Halsted St & Clybourn AveTA130600000833141.91021, -87.643541.909668, -87.6481280.24089942
795B7ADC081755772casualclassic_bike42020-12-09T14:58:00Z2020-12-09T15:08:00Z0:10:36Greenview Ave & Fullerton AveHalsted St & Clybourn AveGreenview Ave & Fullerton Ave to Halsted St & Clybourn AveTA130700000133141.92533, -87.665841.909668, -87.6481281.413006342
839CD27FB31626CD0memberclassic_bike52020-12-10T11:18:00Z2020-12-10T11:30:00Z0:11:19Greenview Ave & Fullerton AveHalsted St & Clybourn AveGreenview Ave & Fullerton Ave to Halsted St & Clybourn AveTA130700000133141.92533, -87.665841.909668, -87.6481281.413006342
95F82004CA928515Ememberclassic_bike62020-12-04T17:25:00Z2020-12-04T17:51:00Z0:25:40Halsted St & 21st StHalsted St & Clybourn AveHalsted St & 21st St to Halsted St & Clybourn Ave1316233141.85378, -87.6466541.909668, -87.6481283.862298702
1063A630ACCB226FB9memberdocked_bike32020-12-01T16:47:00Z2020-12-01T17:01:00Z0:13:40Clinton St & Washington BlvdHalsted St & Clybourn AveClinton St & Washington Blvd to Halsted St & Clybourn AveWL-01233141.88338, -87.6411741.909668, -87.6481281.851270921
11E17C812526F9D612memberclassic_bike42020-12-16T19:26:00Z2020-12-16T19:41:00Z0:14:22Franklin St & Lake StHalsted St & Clybourn AveFranklin St & Lake St to Halsted St & Clybourn AveTA130700011133141.885837, -87.635541.909668, -87.6481281.770041463
1204B9C42C9716C149memberclassic_bike62020-12-11T11:18:00Z2020-12-11T11:27:00Z0:09:12Clark St & Chicago AveHalsted St & Clybourn AveClark St & Chicago Ave to Halsted St & Clybourn Ave1330333141.89675, -87.6308941.909668, -87.6481281.257971375
133F7080AE9A112A65memberclassic_bike22020-12-21T13:48:00Z2020-12-21T13:59:00Z0:10:08Clark St & Chicago AveHalsted St & Clybourn AveClark St & Chicago Ave to Halsted St & Clybourn Ave1330333141.89675, -87.6308941.909668, -87.6481281.257971375
14DFF386148F369DFFcasualdocked_bike62020-12-04T16:48:00Z2020-12-04T17:17:00Z0:28:52Michigan Ave & Pearson StHalsted St & Clybourn AveMichigan Ave & Pearson St to Halsted St & Clybourn Ave1303433141.89766, -87.6235141.909668, -87.6481281.513630094
156C6D711A027111B2casualdocked_bike62020-12-04T16:48:00Z2020-12-04T17:17:00Z0:28:21Michigan Ave & Pearson StHalsted St & Clybourn AveMichigan Ave & Pearson St to Halsted St & Clybourn Ave1303433141.89766, -87.6235141.909668, -87.6481281.513630094
16E91724E781837DD6memberclassic_bike12020-12-27T13:51:00Z2020-12-27T14:04:00Z0:13:44Michigan Ave & Pearson StHalsted St & Clybourn AveMichigan Ave & Pearson St to Halsted St & Clybourn Ave1303433141.89766, -87.6235141.909668, -87.6481281.513630094
17F4299DE0DFDDFD36memberclassic_bike12020-12-27T14:41:00Z2020-12-27T15:05:00Z0:24:50Michigan Ave & Pearson StHalsted St & Clybourn AveMichigan Ave & Pearson St to Halsted St & Clybourn Ave1303433141.89766, -87.6235141.909668, -87.6481281.513630094
180512A33336892105memberclassic_bike62020-12-04T13:04:00Z2020-12-04T13:14:00Z0:09:58Ashland Ave & Augusta BlvdHalsted St & Clybourn AveAshland Ave & Augusta Blvd to Halsted St & Clybourn Ave1324833141.899643, -87.667741.909668, -87.6481281.221793274
19D3C1914BB8301A7Fmemberclassic_bike12020-12-13T17:29:00Z2020-12-13T17:34:00Z0:05:04Larrabee St & Menomonee StHalsted St & Clybourn AveLarrabee St & Menomonee St to Halsted St & Clybourn AveTA130600000733141.91468, -87.6433241.909668, -87.6481280.425489373
209F21F589917D69CCcasualclassic_bike12020-12-06T12:12:00Z2020-12-06T13:15:00Z1:02:14Clark St & Lincoln AveHalsted St & Clybourn AveClark St & Lincoln Ave to Halsted St & Clybourn Ave1317933141.915689, -87.634641.909668, -87.6481280.810492488
21BCC1E5EEDBB31529casualclassic_bike12020-12-06T12:12:00Z2020-12-06T13:15:00Z1:02:04Clark St & Lincoln AveHalsted St & Clybourn AveClark St & Lincoln Ave to Halsted St & Clybourn Ave1317933141.915689, -87.634641.909668, -87.6481280.810492488
22AFE6DE4D8061D6F5memberclassic_bike12020-12-06T14:54:00Z2020-12-06T15:04:00Z0:09:10Clark St & Lincoln AveHalsted St & Clybourn AveClark St & Lincoln Ave to Halsted St & Clybourn Ave1317933141.915689, -87.634641.909668, -87.6481280.810492488
23CAAABC0E9EA76453memberclassic_bike12020-12-06T15:48:00Z2020-12-06T15:57:00Z0:08:57Clark St & Lincoln AveHalsted St & Clybourn AveClark St & Lincoln Ave to Halsted St & Clybourn Ave1317933141.915689, -87.634641.909668, -87.6481280.810492488
24EB83EB7EC542A6FBmemberclassic_bike52020-12-10T09:43:00Z2020-12-10T09:53:00Z0:09:40Clark St & Lincoln AveHalsted St & Clybourn AveClark St & Lincoln Ave to Halsted St & Clybourn Ave1317933141.915689, -87.634641.909668, -87.6481280.810492488
255B9A60CCDD6A98C0memberclassic_bike72020-12-12T19:25:00Z2020-12-12T19:32:00Z0:06:46Clark St & Lincoln AveHalsted St & Clybourn AveClark St & Lincoln Ave to Halsted St & Clybourn Ave1317933141.915689, -87.634641.909668, -87.6481280.810492488
2682B443DA84AA3BEEmemberclassic_bike22020-12-14T14:55:00Z2020-12-14T15:03:00Z0:08:14Clark St & Lincoln AveHalsted St & Clybourn AveClark St & Lincoln Ave to Halsted St & Clybourn Ave1317933141.915689, -87.634641.909668, -87.6481280.810492488
275C13C2A9F537FAF4memberclassic_bike22020-12-14T15:43:00Z2020-12-14T15:53:00Z0:09:19Clark St & Lincoln AveHalsted St & Clybourn AveClark St & Lincoln Ave to Halsted St & Clybourn Ave1317933141.915689, -87.634641.909668, -87.6481280.810492488
2806C887C108F035ABmemberclassic_bike12020-12-27T14:02:00Z2020-12-27T14:14:00Z0:11:30Clark St & Lincoln AveHalsted St & Clybourn AveClark St & Lincoln Ave to Halsted St & Clybourn Ave1317933141.915689, -87.634641.909668, -87.6481280.810492488
29D084CF51C605C6F1memberclassic_bike32020-12-29T10:28:00Z2020-12-29T10:39:00Z0:10:44Clark St & Lincoln AveHalsted St & Clybourn AveClark St & Lincoln Ave to Halsted St & Clybourn Ave1317933141.915689, -87.634641.909668, -87.6481280.810492488
3003926929025B28C4casualclassic_bike32020-12-29T10:29:00Z2020-12-29T10:39:00Z0:10:30Clark St & Lincoln AveHalsted St & Clybourn AveClark St & Lincoln Ave to Halsted St & Clybourn Ave1317933141.915689, -87.634641.909668, -87.6481280.810492488
31E0D35323A3F37120memberclassic_bike42020-12-30T14:30:00Z2020-12-30T14:41:00Z0:11:36Clark St & Lincoln AveHalsted St & Clybourn AveClark St & Lincoln Ave to Halsted St & Clybourn Ave1317933141.915689, -87.634641.909668, -87.6481280.810492488
32B31E1E6AE33A971Acasualclassic_bike62020-12-04T11:04:00Z2020-12-04T11:10:00Z0:05:54Bissell St & Armitage AveHalsted St & Clybourn AveBissell St & Armitage Ave to Halsted St & Clybourn Ave1305933141.91844, -87.6522241.909668, -87.6481280.641575778
3329A5EF9EB208696Cmemberclassic_bike72020-12-19T16:23:00Z2020-12-19T16:37:00Z0:13:53Wilton Ave & Belmont AveHalsted St & Clybourn AveWilton Ave & Belmont Ave to Halsted St & Clybourn AveTA130700013433141.94018, -87.6530441.909668, -87.6481282.123278511
3424D4230E15AB999Cmemberclassic_bike42020-12-23T17:32:00Z2020-12-23T17:48:00Z0:16:13Wilton Ave & Belmont AveHalsted St & Clybourn AveWilton Ave & Belmont Ave to Halsted St & Clybourn AveTA130700013433141.94018, -87.6530441.909668, -87.6481282.123278511
35B487D55039F024CCmemberclassic_bike72020-12-05T14:14:00Z2020-12-05T14:33:00Z0:19:13Halsted St & Roscoe StHalsted St & Clybourn AveHalsted St & Roscoe St to Halsted St & Clybourn AveTA130900002533141.94367, -87.6489541.909668, -87.6481282.34972925
3616B7FFA064B5D6E7memberclassic_bike52020-12-10T23:47:00Z2020-12-11T00:11:00Z0:23:15Southport Ave & Waveland AveHalsted St & Clybourn AveSouthport Ave & Waveland Ave to Halsted St & Clybourn Ave1323533141.94815, -87.6639441.909668, -87.6481282.780353473
37F132B0A5A3A8E618memberclassic_bike72020-12-05T08:59:00Z2020-12-05T09:28:00Z0:28:39Michigan Ave & 18th StHalsted St & Clybourn AveMichigan Ave & 18th St to Halsted St & Clybourn Ave1315033141.857813, -87.6245541.909668, -87.6481283.782615327
38F8A1B3A64886E6DEmemberclassic_bike52020-12-17T09:09:00Z2020-12-17T09:41:00Z0:32:26Michigan Ave & 18th StHalsted St & Clybourn AveMichigan Ave & 18th St to Halsted St & Clybourn Ave1315033141.857813, -87.6245541.909668, -87.6481283.782615327
392BB5A5176858AF4Fmemberclassic_bike62020-12-04T15:35:00Z2020-12-04T16:01:00Z0:25:40Morgan St & Polk StHalsted St & Clybourn AveMorgan St & Polk St to Halsted St & Clybourn AveTA130700013033141.871737, -87.6510341.909668, -87.6481282.625068488
40F7BC88663BD0E589memberclassic_bike72020-12-05T11:22:00Z2020-12-05T11:39:00Z0:16:59Green St & Randolph StHalsted St & Clybourn AveGreen St & Randolph St to Halsted St & Clybourn Ave1305333141.883668, -87.6486741.909668, -87.6481281.796671786
41F2434FA3DA7E375Bmemberclassic_bike22020-12-21T15:48:00Z2020-12-21T15:58:00Z0:10:12Green St & Randolph StHalsted St & Clybourn AveGreen St & Randolph St to Halsted St & Clybourn Ave1305333141.883668, -87.6486741.909668, -87.6481281.796671786
42B9B5896F3987E87Cmemberdocked_bike42020-12-02T19:14:00Z2020-12-02T19:24:00Z0:10:12Orleans St & Merchandise Mart PlazaHalsted St & Clybourn AveOrleans St & Merchandise Mart Plaza to Halsted St & Clybourn AveTA130500002233141.888243, -87.6363941.909668, -87.6481281.598702019
4348317544FE71CA3Dcasualdocked_bike52020-12-03T05:24:00Z2020-12-03T05:36:00Z0:11:45Orleans St & Merchandise Mart PlazaHalsted St & Clybourn AveOrleans St & Merchandise Mart Plaza to Halsted St & Clybourn AveTA130500002233141.888243, -87.6363941.909668, -87.6481281.598702019
449E880C15C20F4C0Ememberclassic_bike72020-12-05T07:47:00Z2020-12-05T08:03:00Z0:15:11Orleans St & Merchandise Mart PlazaHalsted St & Clybourn AveOrleans St & Merchandise Mart Plaza to Halsted St & Clybourn AveTA130500002233141.888243, -87.6363941.909668, -87.6481281.598702019
453946CF247E7412D8memberclassic_bike12020-12-06T09:43:00Z2020-12-06T09:57:00Z0:14:09Orleans St & Merchandise Mart PlazaHalsted St & Clybourn AveOrleans St & Merchandise Mart Plaza to Halsted St & Clybourn AveTA130500002233141.888243, -87.6363941.909668, -87.6481281.598702019
465762DE06DBBF5E56memberclassic_bike52020-12-17T17:24:00Z2020-12-17T17:36:00Z0:11:48Orleans St & Merchandise Mart PlazaHalsted St & Clybourn AveOrleans St & Merchandise Mart Plaza to Halsted St & Clybourn AveTA130500002233141.888243, -87.6363941.909668, -87.6481281.598702019
47480DD48DCE8F8F07memberclassic_bike22020-12-28T15:13:00Z2020-12-28T15:22:00Z0:09:13Orleans St & Merchandise Mart PlazaHalsted St & Clybourn AveOrleans St & Merchandise Mart Plaza to Halsted St & Clybourn AveTA130500002233141.888243, -87.6363941.909668, -87.6481281.598702019
48B044F542D7E52FF5memberclassic_bike42020-12-23T13:18:00Z2020-12-23T13:37:00Z0:19:16Lake Shore Dr & Ohio StHalsted St & Clybourn AveLake Shore Dr & Ohio St to Halsted St & Clybourn AveTA130600002933141.89257, -87.61449241.909668, -87.6481282.094717503
49D000F7DF98EB762Cmemberclassic_bike52020-12-31T17:21:00Z2020-12-31T17:38:00Z0:17:25Lake Shore Dr & Ohio StHalsted St & Clybourn AveLake Shore Dr & Ohio St to Halsted St & Clybourn AveTA130600002933141.89257, -87.61449241.909668, -87.6481282.094717503
503BDEE3EFF60A7715casualclassic_bike22020-12-21T12:24:00Z2020-12-21T12:44:00Z0:20:29Damen Ave & Chicago AveHalsted St & Clybourn AveDamen Ave & Chicago Ave to Halsted St & Clybourn Ave1313233141.895769, -87.6772241.909668, -87.6481281.777778451
December_2020_trimmed_v2
Cell Formulas
RangeFormula
J2:J50J2=CONCAT(H2," to ", I2)
 

Attachments

  • 1639539472227.png
    1639539472227.png
    10 KB · Views: 11

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
Hi zgold,

Maybe this suits, probably the easiest to deal with considering your data size?

Using a Pivot Table with these Pivot Table fields
  • Filters = user_type (this allows to switch between All / member / casual with drop down or Slicer)
  • Rows = route_taken
  • Values = Drag user-type, this will become "Count of user_type"
  • Right Click on the 1st route in the Pivot Table, Choose Filter / Top 10 / in the "Show criteria" enter 100 for the Top 100 routes
  • Right Click the 1st count value in the pivot table, Sort Largest to Smallest (which is Z-A)
Book1
AB
1user_typemember
2
3route_takenCount of user_type
4Clark St & Lincoln Ave to Halsted St & Clybourn Ave9
5Orleans St & Merchandise Mart Plaza to Halsted St & Clybourn Ave5
6Larrabee St & North Ave to Halsted St & Clybourn Ave4
7Wilton Ave & Belmont Ave to Halsted St & Clybourn Ave2
8Clark St & Chicago Ave to Halsted St & Clybourn Ave2
9Lake Shore Dr & Ohio St to Halsted St & Clybourn Ave2
10Michigan Ave & Pearson St to Halsted St & Clybourn Ave2
11Michigan Ave & 18th St to Halsted St & Clybourn Ave2
12Green St & Randolph St to Halsted St & Clybourn Ave2
13Clinton St & Washington Blvd to Halsted St & Clybourn Ave1
14Franklin St & Lake St to Halsted St & Clybourn Ave1
15Larrabee St & Menomonee St to Halsted St & Clybourn Ave1
16Morgan St & Polk St to Halsted St & Clybourn Ave1
17Greenview Ave & Fullerton Ave to Halsted St & Clybourn Ave1
18Southport Ave & Waveland Ave to Halsted St & Clybourn Ave1
19Halsted St & 21st St to Halsted St & Clybourn Ave1
20Ashland Ave & Augusta Blvd to Halsted St & Clybourn Ave1
21Halsted St & Roscoe St to Halsted St & Clybourn Ave1
Sheet2
 
Upvote 0
Solution
Another option with formulae. The Qty in Q2 is the max number of rows returned.
+Fluff 1.xlsm
ABJPQRSTU
1ride_iduser_typeroute_takenQtyRouteTotalMemberCasual
28AC7643FDA05E1D4memberLarrabee St & North Ave to Halsted St & Clybourn Ave10Clark St & Lincoln Ave to Halsted St & Clybourn Ave1293
322B721668F54DF09memberLarrabee St & North Ave to Halsted St & Clybourn AveOrleans St & Merchandise Mart Plaza to Halsted St & Clybourn Ave651
40AE1B9DB2F1F8BC2memberLarrabee St & North Ave to Halsted St & Clybourn AveLarrabee St & North Ave to Halsted St & Clybourn Ave541
58DAEDE1893BCCBC8memberLarrabee St & North Ave to Halsted St & Clybourn AveMichigan Ave & Pearson St to Halsted St & Clybourn Ave422
6EEC33E416B277B7AcasualLarrabee St & North Ave to Halsted St & Clybourn AveGreenview Ave & Fullerton Ave to Halsted St & Clybourn Ave211
795B7ADC081755772casualGreenview Ave & Fullerton Ave to Halsted St & Clybourn AveClark St & Chicago Ave to Halsted St & Clybourn Ave220
839CD27FB31626CD0memberGreenview Ave & Fullerton Ave to Halsted St & Clybourn AveWilton Ave & Belmont Ave to Halsted St & Clybourn Ave220
95F82004CA928515EmemberHalsted St & 21st St to Halsted St & Clybourn AveMichigan Ave & 18th St to Halsted St & Clybourn Ave220
1063A630ACCB226FB9memberClinton St & Washington Blvd to Halsted St & Clybourn AveGreen St & Randolph St to Halsted St & Clybourn Ave220
11E17C812526F9D612memberFranklin St & Lake St to Halsted St & Clybourn AveLake Shore Dr & Ohio St to Halsted St & Clybourn Ave220
1204B9C42C9716C149memberClark St & Chicago Ave to Halsted St & Clybourn Ave
133F7080AE9A112A65memberClark St & Chicago Ave to Halsted St & Clybourn Ave
14DFF386148F369DFFcasualMichigan Ave & Pearson St to Halsted St & Clybourn Ave
156C6D711A027111B2casualMichigan Ave & Pearson St to Halsted St & Clybourn Ave
16E91724E781837DD6memberMichigan Ave & Pearson St to Halsted St & Clybourn Ave
17F4299DE0DFDDFD36memberMichigan Ave & Pearson St to Halsted St & Clybourn Ave
180512A33336892105memberAshland Ave & Augusta Blvd to Halsted St & Clybourn Ave
19D3C1914BB8301A7FmemberLarrabee St & Menomonee St to Halsted St & Clybourn Ave
209F21F589917D69CCcasualClark St & Lincoln Ave to Halsted St & Clybourn Ave
21BCC1E5EEDBB31529casualClark St & Lincoln Ave to Halsted St & Clybourn Ave
22AFE6DE4D8061D6F5memberClark St & Lincoln Ave to Halsted St & Clybourn Ave
23CAAABC0E9EA76453memberClark St & Lincoln Ave to Halsted St & Clybourn Ave
24EB83EB7EC542A6FBmemberClark St & Lincoln Ave to Halsted St & Clybourn Ave
255B9A60CCDD6A98C0memberClark St & Lincoln Ave to Halsted St & Clybourn Ave
2682B443DA84AA3BEEmemberClark St & Lincoln Ave to Halsted St & Clybourn Ave
275C13C2A9F537FAF4memberClark St & Lincoln Ave to Halsted St & Clybourn Ave
2806C887C108F035ABmemberClark St & Lincoln Ave to Halsted St & Clybourn Ave
29D084CF51C605C6F1memberClark St & Lincoln Ave to Halsted St & Clybourn Ave
3003926929025B28C4casualClark St & Lincoln Ave to Halsted St & Clybourn Ave
31E0D35323A3F37120memberClark St & Lincoln Ave to Halsted St & Clybourn Ave
32B31E1E6AE33A971AcasualBissell St & Armitage Ave to Halsted St & Clybourn Ave
3329A5EF9EB208696CmemberWilton Ave & Belmont Ave to Halsted St & Clybourn Ave
3424D4230E15AB999CmemberWilton Ave & Belmont Ave to Halsted St & Clybourn Ave
35B487D55039F024CCmemberHalsted St & Roscoe St to Halsted St & Clybourn Ave
3616B7FFA064B5D6E7memberSouthport Ave & Waveland Ave to Halsted St & Clybourn Ave
37F132B0A5A3A8E618memberMichigan Ave & 18th St to Halsted St & Clybourn Ave
38F8A1B3A64886E6DEmemberMichigan Ave & 18th St to Halsted St & Clybourn Ave
392BB5A5176858AF4FmemberMorgan St & Polk St to Halsted St & Clybourn Ave
40F7BC88663BD0E589memberGreen St & Randolph St to Halsted St & Clybourn Ave
41F2434FA3DA7E375BmemberGreen St & Randolph St to Halsted St & Clybourn Ave
42B9B5896F3987E87CmemberOrleans St & Merchandise Mart Plaza to Halsted St & Clybourn Ave
4348317544FE71CA3DcasualOrleans St & Merchandise Mart Plaza to Halsted St & Clybourn Ave
449E880C15C20F4C0EmemberOrleans St & Merchandise Mart Plaza to Halsted St & Clybourn Ave
453946CF247E7412D8memberOrleans St & Merchandise Mart Plaza to Halsted St & Clybourn Ave
465762DE06DBBF5E56memberOrleans St & Merchandise Mart Plaza to Halsted St & Clybourn Ave
47480DD48DCE8F8F07memberOrleans St & Merchandise Mart Plaza to Halsted St & Clybourn Ave
48B044F542D7E52FF5memberLake Shore Dr & Ohio St to Halsted St & Clybourn Ave
49D000F7DF98EB762CmemberLake Shore Dr & Ohio St to Halsted St & Clybourn Ave
503BDEE3EFF60A7715casualDamen Ave & Chicago Ave to Halsted St & Clybourn Ave
Lists
Cell Formulas
RangeFormula
R2:U11R2=LET(u,UNIQUE(FILTER(J2:J500,J2:J500<>"")),INDEX(SORT(CHOOSE({1,2,3,4},u,COUNTIFS(J2:J500,u),COUNTIFS(B2:B500,"Member",J2:J500,u),COUNTIFS(B2:B500,"casual",J2:J500,u)),2,-1),SEQUENCE(MIN(Q2,ROWS(u))),{1,2,3,4}))
J2:J50J2=CONCAT(H2," to ", I2)
Dynamic array formulas.
 
Upvote 0
@Fluff @RasGhul Thank you for your help!

[Part 1] I think the pivot table that @RasGhul showed is what would work best. However, I am also looking for a way to include (the route_id and more importantly) the avg_time (i. e. average ride_length) for all trips taken for the specific frequented route (can this be automated with the pivot table or does it have to be done manually?). Currently, the frequent_routes pivot table only includes the amount of time (ride_length) per each individual ride situated beneath the route_taken row (if ride_length included in column section of pivot table) and that is displayed vertically together with the route_id. See MiniSheet

December_2020_trimmed.12.16.21.xlsx
ABCDE
1
2Pivot Table 'Frequented Routes'
3Most frequented routes & stations between both casual/member users
4
5user_typemember
6
7frequent_routesnumber_of_tripsavg_timeroute_id
8Dearborn St & Erie St to Dearborn St & Erie St122<time><id>
900:01:081
1013045 - 130451
1100:02:571
1213045 - 130451
1300:03:591
1413045 - 130451
1500:04:561
1613045 - 130451
1700:05:321
1813045 - 130451
1900:05:581
2013045 - 130451
frequent_routes_pt
Cells with Conditional Formatting
CellConditionCell FormatStop If True
B8:B40Cell Valuetop 10 valuestextNO
B8:B40Other TypeColor scaleNO


[Part 2] Secondly, I think I did see @Fluff touch upon this in his formula slightly (which was hard for me to follow anyway), however, I am looking to figure out a way that I could display the top shared_routes among both casual/member users. In other words, I would like the results to show the routes where the ratio of between both member/casual users are the highest i.e. which routes are the most common (either top 10-50) between them both and how those numbers are distributed between them both (e.g. the route ABC street to XYZ st is highest frequented route between both member/casual users and is distributed as 20 trips for member 14 for casual with a route_id of AZXC123 and average trip time (avg_time) of 00:25:23))).

See embedded MiniSheet

December_2020_trimmed.12.16.21.xlsx
GHIJKL
1
2Pivot Table 'Shared Routes'
3Most shared routes & stations among casual/member users
4
5
6number_of_tripsavg_time
7shared_routesmembercasualmembercasualroute_id
8<name><number><number><time><time><id>
9<name>
10<name>
11<name>
12<name>
13<name>
14
15<total><total><total><total>
16<grand total><grand total>
frequent_routes_pt


NOTE: The pivot_tables are on a separate sheet from the main data source which is here:

December_2020_trimmed.12.16.21.xlsx
B
15member
December_2020


[Part 3] With regard to getting the average time for ride_length, for some reason whenever I type in the =average() formula and try to get an average from my ride_length column I get an error.

December_2020_trimmed.12.16.21.xlsx
GH
1ride_length
200:40:05#DIV/0!
300:21:56#DIV/0!
400:03:03
500:03:00
600:13:05
700:10:36
December_2020
Cell Formulas
RangeFormula
H2H2=AVERAGE(G2:G6)
H3H3=AVERAGE(G3:G8)


I assume that my data type on the ride_length column is messing up the formula, but I keep on trying to change it to hh:mm:ss format but that doesn't seem to help. Another odd thing I experienced is that when I double click the cell it keeps on reverting back to date format. See sheet


December_2020_trimmed.12.16.21.xlsx
GH
240:05.040:05.0
300:21:56#DIV/0!
400:03:03
500:03:00
600:13:05
December_2020
Cell Formulas
RangeFormula
H2H2=AVERAGE(G2:G6)
H3H3=AVERAGE(G3:G8)



I want the data type to always stay in 'stopwatch' format (for lack of a better term i.e. hh:mm:ss). This issue is also bleeding over into my pivot tables. Any solutions would be greatly appreciated!
 
Upvote 0
Hi Zgold,

Here's the pivot table output if you
  • Drag ride_length under Count of user_type in the Values PT field
  • This defaults to Sum of ride_length - right click top value, Summarize values by Average
  • Right Click top value - Number Format / Custom / hh:mm:ss
  • Drag ride_id under route_taken in the PT Rows field
  • You can still swap between All / member / casual
Total Average per route with Average time per ride_id

Count and order (from A-Z) number of recurring text strings_zgoldflo.xlsx
ABC
1user_type(All)
2
3Row LabelsCount of user_typeAverage of ride_length
4Clark St & Lincoln Ave to Halsted St & Clybourn Ave120:18:24
503926929025B28C410:10:30
606C887C108F035AB10:11:30
75B9A60CCDD6A98C010:06:46
85C13C2A9F537FAF410:09:19
982B443DA84AA3BEE10:08:14
109F21F589917D69CC11:02:14
11AFE6DE4D8061D6F510:09:10
12BCC1E5EEDBB3152911:02:04
13CAAABC0E9EA7645310:08:57
14D084CF51C605C6F110:10:44
15E0D35323A3F3712010:11:36
16EB83EB7EC542A6FB10:09:40
17Orleans St & Merchandise Mart Plaza to Halsted St & Clybourn Ave60:12:03
183946CF247E7412D810:14:09
19480DD48DCE8F8F0710:09:13
2048317544FE71CA3D10:11:45
215762DE06DBBF5E5610:11:48
229E880C15C20F4C0E10:15:11
23B9B5896F3987E87C10:10:12
24Larrabee St & North Ave to Halsted St & Clybourn Ave50:16:14
250AE1B9DB2F1F8BC210:03:03
2622B721668F54DF0910:21:56
278AC7643FDA05E1D410:40:05
288DAEDE1893BCCBC810:03:00
29EEC33E416B277B7A10:13:05
30Michigan Ave & Pearson St to Halsted St & Clybourn Ave40:23:57
316C6D711A027111B210:28:21
32DFF386148F369DFF10:28:52
33E91724E781837DD610:13:44
34F4299DE0DFDDFD3610:24:50
35Clark St & Chicago Ave to Halsted St & Clybourn Ave20:09:40
3604B9C42C9716C14910:09:12
373F7080AE9A112A6510:10:08
Sheet2
 
Upvote 0
@RasGhul Thanks!

I tried to do that but I am getting an error. Here is a short Loom video documenting my error. I will also include a Minisheet with the current error state:

December_2020_trimmed.12.16.21.xlsx
D
8#DIV/0!
frequent_routes_pt


Step-by-step what I did.

  1. Took ride_length and dragged it into VALUES field of pivot table under user_type.
  2. Another column appeared alongside count of user_type but had the same exact values as the count of user_type column.
  3. I then right-clicked to Summarize values by > Average and I received an error #DIV/0!
  4. I then right-clicked Number Format>Custom>h:mm:ss
Is the data type for ride_length incorrect?

What might be the issue here? I also refreshed my Pivot Table.

1639708965801.png
 
Upvote 0
If ride_length defaulted to count & not sum this normally means it has detected text values.

from your source data "December 2020...", when I highlight the first 3 rows of ride_length, on the bottom of the excel window it shows Average 0.015 Count 3 Sum: 0.045185185
this sum figure confirms for me that this data is actual number values, if you only see a Count value - excel only sees this data as text.
I copied your trimmed data from your original post so I suggest the following - pivot table sum then average...

Maybe try - re-drag ride_length as per my instructions to below Count of user_type, the click the down arrow for the ride_length field and select value field settings / sum
Hopefully now the pivot table has calculated the sum of ride_length, now you should be able to choose summarize values as / average.
 
Upvote 0
Hi @RasGhul ,

Yes, I did try this a number of times. I even recreated the Pivot Table and ensured the source data was correctly formatted - I have attached another Loom video to share with you the error I am experiencing. I am thinking maybe parsing the ride_length data and then concatenate the data afterward? Saw this thread at answers.microsoft. Just a bit at ends wits here. Thanks for sticking it out with me though.
 
Upvote 0
Ok lets test

Can you insert a column in your source data after ride_length Column G
This might now be called Column1 as your source data should now be an excel table
in Cell H2 enter

Excel Formula:
=istext([@[ride_length]])

for all of this helper column 1 I get false, which confirms these are numeric values to calculate sum or average from
if your column returns TRUE then we can convert this to values
  • in our new helper column clear the istext test so we have a fresh column
  • Call this ride_length_convert
  • in H2 enter
    Excel Formula:
    =VALUE(LEFT([@[ride_length]],11))
  • format as hh:mm:ss
  • now we can use "ride_length_convert" in the pivot table instead
For curiousity sake my regional settings are, (I want to avoid you changing these yet until we exhaust excel problems 1st. ;))

Short date d/MM/yyyy
Long Date dddd, d MMMM yyyy
Short Time h:mm:ss tt
 
Upvote 0
Woohoo!

You deserve a medal! After a couple of error messages, I think we pulled through.

I'd like to show you the following.

December_2020_trimmed.12.16.21.xlsx
ABCDEF
1
2Pivot Table 'Frequented Routes'
3Most frequented routes & stations between both casual/member users
4
5user_typecasual
6bike_type_count
7frequent_routestrip_countavg_ride_lengthclassic_bikeelectric_bike
8Michigan Ave & 18th St to Michigan Ave & 18th St370:30:09352
913150 - 13150370:30:09
1000:01:0110:01:01
11classic_bike10:01:01
1200:16:4910:16:49
13classic_bike10:16:49
1400:24:2610:24:26
15classic_bike10:24:26
1600:24:3310:24:33
17classic_bike10:24:33
1800:25:0610:25:06
19classic_bike10:25:06
2000:25:4110:25:41
21classic_bike10:25:41
2200:25:5010:25:50
23classic_bike10:25:50
2400:26:1010:26:10
25classic_bike10:26:10
frequent_routes_pt
Cells with Conditional Formatting
CellConditionCell FormatStop If True
B8:B40Cell Valuetop 10 valuestextNO
B8:B40Other TypeColor scaleNO


If I haven't already worn out my graces with the great and mighty @RasGhul might I ask - is there any way to extract from each route the number and variation of bike_type used (i.e. classic bike vs electric bike) e.g. for the route Michigan Ave & 18th St to Michigan Ave & 18th St : 13150 - 13150 (route_id) there were 35 classic bikes used and only 2 electric. Is there a way I can populate that data for all top ten trips or would it have to be manually counted and parsed?
 
Upvote 0

Forum statistics

Threads
1,223,238
Messages
6,170,939
Members
452,368
Latest member
jayp2104

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top