I have a list of lists created and i need to insert an element that counts the number of times the same item appears in the list in index 3. I tried to do a sort, because i think it’s the easiest way but when i do it i have problems with the index. Help !
I’m sorry my title maybe is not the best. I dont have a legend or a text box that i say what i want to count.
I was trying to acomplish is for each element added to the list how many times the element in index 3 repeats and add a “column” with this count or sum.
That’s why i talked about the sort, so i can compare the current item to the previous.
This list is small, but it will be longer, so i can’t set up a legend for each element.
Alternatively, set up a dictionary (empty) with the tags being country names, and their values being the count encountered so far in your traversal of the table, 0 if not found.
Add 1 to the count for that country each time you encounter it in the for each loop.