From a csv achieved by a badge to a ranking

DaWebmasta

New Member
Joined
Jun 28, 2020
Messages
8
Office Version
  1. 2013
Platform
  1. Windows
Hi everyone,
Sorry for my bad English but I'm trying my best. I am the webmaster of an amateur cycling team with about 160 members and every Sunday we ride a ride. The riders have a badge (card) and must therefore log in every Sunday. So every Sunday I receive a csv file as in this example below.

ride01.csv (65 km)
ride01.csv
A
1Date,Time,Terminal ID,User ID,Name,Employee ID,Class,Mode,Type,Card Serial No.,Result,Property,External Device,Coordinate
22020-03-08,09:53:24,0008 : jdjd,00003002,Smith John,3002,User,Access,Card,01324047,Success,1000,,0 / 0
32020-03-08,09:52:15,0008 : jdjd,00004003,King Ronny,4003,User,Access,Card,01324052,Success,1000,,0 / 0
42020-03-08,09:51:59,0008 : jdjd,00007036,Presley Elvis,7036,User,Access,Card,01636049,Success,1000,,0 / 0
52020-03-08,09:49:41,0008 : jdjd,00004016,Wade Duane,4016,User,Access,Card,01636043,Success,1000,,0 / 0
ride01


Next sunday I get ride02.csv (55 km)
ride02.csv
A
1Date,Time,Terminal ID,User ID,Name,Employee ID,Class,Mode,Type,Card Serial No.,Result,Property,External Device,Coordinate
22020-03-08,09:52:15,0008 : jdjd,00004003,King Ronny,4003,User,Access,Card,01324052,Success,1000,,0 / 0
32020-03-08,09:49:41,0008 : jdjd,00004016,Wade Duane,4016,User,Access,Card,01636043,Success,1000,,0 / 0
42020-03-08,09:53:24,0008 : jdjd,00003002,Smith John,3002,User,Access,Card,01324047,Success,1000,,0 / 0
52020-03-08,09:51:59,0008 : jdjd,00007033,Travolta John,7033,User,Access,Card,01636046,Success,1000,,0 / 0
ride02


And so on...
Now I want to make a ranking with the following information: ranking, name (based on total points), cardnumber, total mileage and total points.
When you participate (so every time you use your badge) you should get 3 points. If you don't participate you get zero points

Now I make that ranking manually. It is the intention that everything is done automatically as much as possible. So it should look something like this after 2 stages or rides.

ranking.csv
ABCDE
1RankNameCardnumberTotal kmTotal points
21King Ronny40031206
32Smith John30021206
43Wade Duane40161206
54Travolta John7033553
65Presley Elvis7036653
ranking


So I can place The ranking CSV on the internet.

Is it possible? Can it be done?
I don't know how to do it right away. I can put a simple formula in Excel, but how it should be done with the total number of km and assigning the points there I am really stuck.

Thank you very much in advance!
 

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"
This formula will extract the names,

VBA Code:
=TRIM(MID(SUBSTITUTE(A2, ",", REPT(" ", LEN(A2))), LEN(A2)*4, LEN(A2)))

Incrementing the number after the * to 5 will give you the card number

VBA Code:
=TRIM(MID(SUBSTITUTE(A2, ",", REPT(" ", LEN(A2))), LEN(A2)*5, LEN(A2)))

Because there is no miles in the data for each ride you will have to add them in manual. The formula example can be added below each CSV table or placed somewhere else. but to retain a master total will need VBA. But hopefully this gives you a start point.
 
Upvote 0
Hello,

Thanks for your reaction.
I know nothing about VBA. I'll see what I can found about VBA basics on the internet.

Greetings!
 
Upvote 0
Mmmm, those VBA youtube courses for beginners will not help me right away with my problem...
Is it a good idea to start a ranking file with the non-variables like the name and the card number and add them in manual. So I start with:
ranking.csv
ABCDE
1RankNameCardnumberTotal kmTotal points
2King Ronny4003
3Smith John3002
4Wade Duane4016
5Travolta John7033
6Presley Elvis7036
ranking


Let's start with the points. Is it possible to see if a cardnumber appears in file (let's say in ride01.csv) it will increase the total points by 3 in cell E2?
For example: If 4003 is found in ride01.csv so Ronny King will get 3 points?

i'm such a dummie

Grtz
 
Upvote 0
@DaWebmasta I cannot be certain but, I suspect that you perhaps do not wish nor need to utilise vba?
I do not know the exact form of your spreadsheet nor, if there are other factors that would make the below unworkable.
However, I have quickly done the below, using only standard Excel features.

In this form, each csv dataset is pasted into column A, below the the previous.
Using Data > Text To Columns, the input data is split to columns in about 8 clicks ( 10 seconds)
The distance of the ride needs to be entered in the new header row, in column P. ( Shown as green )
(Note there are formulas copied down in P. Entering a new distance will overwrite the formula in the header row but that's good!!)

The irrelevant columns are hidden.
The table on the right is essentially a list of all members.
Stats are picked up by formulas in U & V and the table can be sorted on column V as and when required.

Book1
AEFPQRSTUV
1Distance
2DateNameEmployee ID65NameNumberKmPoints
308/03/2020Smith John300265King Ronny40031206
408/03/2020King Ronny400365Wade Duane40161206
508/03/2020Presley Elvis703665Smith John30021206
608/03/2020Wade Duane401665Travolta john7033553
7Presley Elvis7036653
8DateNameEmployee ID55Trump Donald999900
908/03/2020King Ronny400355 
1008/03/2020Wade Duane401655 
1108/03/2020Smith John300255 
1208/03/2020Travolta John703355 
13  
Sheet2
Cell Formulas
RangeFormula
P3:P6, P9:P13P3=IF(F3="","",P2)
U3:U8U3=SUMIF(E:E,S3,P:P)
V3:V13V3=IF(S3="","",COUNTIF(E:E,S3)*3)


It may not be the perfect answer but hope it helps.

Don't hesitate to ask if you need more explanation.
 
Upvote 0
Hello Snakehips,

Again, sorry for my bad English.

Thanks for your answer!!!! It's not that I don't want to use vba. It's just that I don't know anything about it. I watched some beginner videos on Youtube. It is super interesting but I couldn't take it any further for this project.
I understand the examples you show me without VBA. It's very clear and I understand what you're doing. I'll try it out in a minute.

In your example, all input is pasted into column A. Is it possible to paste the data every time into a new sheet for each cycling trip (because it concerns more than 100 participants over 30 trips and then it quickly becomes a very long and unclear file)
 
Upvote 0
Please do not apologise for your English. It is far more better than what my English are!

The choice is entirely yours. If you want to really automate the process then you have to go vba. Then you can virtually do anything you want with any data layout.
If you do not go vba then I feel that the simplest way to extract the overall stats is from the single sheet listing.

However, there is nothing at all to stop you having a separate sheet for each event and, maybe, computing some event stats on that sheet.
So all you would do is copy the event csv to a dedicated sheet and then copy paste the data values to the bottom of the overall calculation sheet.?

The summary itself could be on a separate sheet.?
 
Upvote 0

Forum statistics

Threads
1,214,985
Messages
6,122,606
Members
449,089
Latest member
Motoracer88

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