Sorting Legal Citations
Posted by Scott England on December 17, 2001 3:30 PM
I am having trouble sorting a two-column table that contains legal citations. The problem is that the jurisdiction's citation system is much more complex than anything that the program seems designed to handle. To give you an idea, a citation may look like this: 225 ILCS 5/402.1(a)(3).
Is there any way that I can "train" Excel to learn the citation system? If that's not possible, is there an easy way to break the citations up into separate parts so that Excel can sort it properly?
My Excel skills are pretty limited, so any help you're able to give me will probably have to be fairly explicit for me to understand.
Many thanks in advance...
Posted by DaK on December 17, 2001 3:33 PM
Re: More info please
What information is in the two columns? How does that data have to be sorted i.e. alphabettcaly or by number? What part is sorted?
I'll try to help if I can.
DaK
Posted by Scott England on December 17, 2001 3:55 PM
Re: More info please
Thanks for the quick response. I need to be able to sort by both columns. The first column contains section numbers that are sometimes followed by subsections in parentheses. For example, 5202(1)(a) precedes 5202(1)(b) and 5202(2). Sorting by this column has not really been a problem.
The second column is what I need help with. This column contains entries similar to the one I gave as an example in my original post. It too needs to be sorted by numbers for the most part, but it's a much more complicated citation system than the sorts of section numbers that appear in the first column.
The problem, I think, is that there are several different parts of the citation that can affect its proper sorting. For example, "5 ILCS 10/1-100" would properly precede "10 ILCS 10/1-100" in an ascending sort because of its lower chapter number (5 vs. 10), but would follow "5 ILCS 5/1-100" because of its higher act number (10 vs. 5). Similarly, "10 ILCS 11/1-100" would precede "10 ILCS 12/2-100" because of its lower section number (1 vs. 2), but would follow "10 ILCS 10B/1-100" or "10 ILCS 10.1/1-100" because of its higher act number (11 vs. 10B and 10.1).
I hope that gives you enough information...
Posted by Scott England on December 17, 2001 4:05 PM
whoops!
The last sentence in the third paragraph should read as follows: "Similarly, '10 ILCS 11/1-100' would precede '10 ILCS 11/2-100' because of its lower section number (1 vs. 2), but would follow '10 ILCS 10B/1-100' or '10 ILCS 10.1/1-100' because of its higher act number (11 vs. 10B and 10.1)."
Sorry for any confusion I haven't already caused.
Posted by DaK on December 17, 2001 4:08 PM
Re: More info please
Ok, I'm still a little confused. Sorry, I'm not familiar with citations.
Is the information in the first column related to the info in the second? What I mean is does the section numbers have to be lined up with the correct citation number? If so, make sure you highlight both colums at the same time when you do the sort and sort by column "A". This would keep everything lined up.
If not, how is the second column to be sorted. The way you explained how it is sorting is correct, however I'm not sure how you want it to sort.
How are you doing the sort, is it through vba or are you manualy selecting sort form the toolbar or menu? If its code, post the code so that I can look at it. If its manualy, tell me how you are doing it and your desired results.
Sorry, I know its a pain.
DaK
Posted by Scott England on December 18, 2001 8:05 AM
Re: More info please
Thanks for the response. The information in the first column is related to the information in the second column, and does need to be "lined up" by row. Like I said, sorting by the first column has not been a problembut sorting by the second column (which I want to do when information was originally entered in the order of the first column) has. Because I have many entries, manually sorting by moving rows is a real pain in the neck.
The examples I gave were of the proper sorting of the second column (which is what I'm trying to get) rather than of the actual Excel sorting. The actual sorting makes the following sorts of mistakes: puts 225 ILCS 209/90 before 225 ILCS 25/40; puts 225 ILCS 41/15-75 between 225 ILCS 340/34 and 225 ILCS 410/2A-4; and puts anything in "105 ILCS" before anything in "15 ILCS."
So far, I've been sorting by using the toolbar. I've tried "formatting" the troublesome column to change the cells' "category" (general, number, text, etc.), but this doesn't seem to make an appreciable difference.
I am encouraged by your references to "vba" and "codes," but, knowing very little about Excel, am not familiar with those sorting techniques. Is there a way that I can create a code to "teach" the program the proper sorting?
Many thanks.
Posted by DaK on December 18, 2001 1:13 PM
Re: More info please
Ok, now we are getting somewhere. If the columns are next to each other, you should be able to highlight (select) both columns at the same time.
For ex. Click in a1 and drag to b10, both columns would be selected at the same time. Then when you manually sort, sort by the column that contains the sections, not the citations. This should give you a proper sort if sections and citations are related and supposed to be lined up on the same row.
Can this be done by code? Absolutely, especially if the columns are not next to each other. I don't think you would want to "teach" excel to know how citations work, it would be easier to program the sort.
Try using the macro recorder or give me specific cell ranges that are being sorted and exactly what the end result looks like and I can write the code for you.
DaK
Posted by Scott England on December 18, 2001 2:33 PM
Re: More info please
DaK,
Thanks for your continued efforts to help, but I am discovering that using WordPerfect to deal with these matters is actually a little easier, and have decided to tackle the problem in that program...
Take care,
Scott England : Thanks for the response. The information in the first column is related to the information in the second column, and does need to be "lined up" by row. Like I said, sorting by the first column has not been a problembut sorting by the second column (which I want to do when information was originally entered in the order of the first column) has. Because I have many entries, manually sorting by moving rows is a real pain in the neck. : The examples I gave were of the proper sorting of the second column (which is what I'm trying to get) rather than of the actual Excel sorting. The actual sorting makes the following sorts of mistakes: puts 225 ILCS 209/90 before 225 ILCS 25/40; puts 225 ILCS 41/15-75 between 225 ILCS 340/34 and 225 ILCS 410/2A-4; and puts anything in "105 ILCS" before anything in "15 ILCS." : So far, I've been sorting by using the toolbar. I've tried "formatting" the troublesome column to change the cells' "category" (general, number, text, etc.), but this doesn't seem to make an appreciable difference. : I am encouraged by your references to "vba" and "codes," but, knowing very little about Excel, am not familiar with those sorting techniques. Is there a way that I can create a code to "teach" the program the proper sorting? : Many thanks. :