<?xml version="1.0"?>
<!-- name="generator" content="blosxom/2.0" -->
<!DOCTYPE rss PUBLIC "-//Netscape Communications//DTD RSS 0.91//EN" "http://my.netscape.com/publish/formats/rss-0.91.dtd">

<rss version="0.91">
  <channel>
    <title>e dot dot dot   </title>
    <link>http://www.jamesraposa.com/index</link>
    <description>e dot dot dot - a mostly about the Internet weblog by James Raposa</description>
    <language>en</language>

  <item>
    <title>How to sort groups of rows in Excel</title>
    <link>http://www.jamesraposa.com/index/2026/01/27#sort_groups_of_rows</link>
    <description>In my day job, I work with a software&lt;br /&gt;product that universities use to manage the&lt;br /&gt;business of running a university (such&lt;br /&gt;software packages are called ERP's, which&lt;br /&gt;stands for Enterprise Resource Planning, and&lt;br /&gt;the name of the product is Colleague, put&lt;br /&gt;out and supported by a company called&lt;br /&gt;Ellucian.)&lt;br /&gt;&lt;br /&gt;The ERP has screens (i.e. web pages)&lt;br /&gt;university staff and faculty use to access&lt;br /&gt;and maintain information in the ERP. Each&lt;br /&gt;web page/screen is accessed by either&lt;br /&gt;clicking directly on the screen's&lt;br /&gt;name/description on the ERP's UI menu, or by&lt;br /&gt;directly entering what Ellucian calls a&lt;br /&gt;mnemonic, which is usually just a short,&lt;br /&gt;unique acronym for the description of the&lt;br /&gt;screen.&lt;br /&gt;&lt;br /&gt;I keep a text file list of some of the more&lt;br /&gt;useful mnemonics and their descriptions for&lt;br /&gt;quick access to them, especially the ones I&lt;br /&gt;use infrequently.&lt;br /&gt;&lt;br /&gt;Part of the list is shown below (after I've&lt;br /&gt;pasted it into Excel):&lt;br /&gt;&lt;br /&gt;&lt;img src=&quot;http://www.jamesraposa.com/images/mnemonic-list-screenshot-2026-01-12 214122.png&quot; style=&quot;border: 1px dashed&quot; width=250 height=400&gt;&lt;br /&gt;&lt;br /&gt;I usually just append new entries to the&lt;br /&gt;list, but now there are so many, I felt it&lt;br /&gt;would be nice to copy the list and paste it&lt;br /&gt;into Excel and sort it, and then copy the&lt;br /&gt;sorted list back into my mnemonic list text&lt;br /&gt;file.&lt;br /&gt;&lt;br /&gt;So that's what I did, thinking it would be a&lt;br /&gt;small matter to sort it alphabetically. I&lt;br /&gt;soon learned sorting lists that look like&lt;br /&gt;what's shown in the example, is not&lt;br /&gt;something easily done in Excel.&lt;br /&gt;&lt;br /&gt;I searched Google for &quot;How to sort groups of&lt;br /&gt;rows in Excel&quot;, and what I found is that&lt;br /&gt;apparently there is nothing built into Excel&lt;br /&gt;that allows sorting groups of a fixed number&lt;br /&gt;of rows, using the first row of each group&lt;br /&gt;as what to sort by.&lt;br /&gt;&lt;br /&gt;I did find many suggestions on adding&lt;br /&gt;columns to the spreadsheet, so as to use&lt;br /&gt;them for sorting, but either nothing&lt;br /&gt;perfectly addressed what I wanted to do, or&lt;br /&gt;suggestions were overly complicated.&lt;br /&gt;&lt;br /&gt;I'll explain more about what I ended up&lt;br /&gt;doing below this next image, which resulted&lt;br /&gt;in a sorted list, using the first row of&lt;br /&gt;each group as the key, while maintaining the&lt;br /&gt;fixed number of rows for each group:&lt;br /&gt;&lt;br /&gt;&lt;img src=&quot;http://www.jamesraposa.com/images/mnemonic-list-screenshot 2-2026-01-12 214122.png&quot; style=&quot;border: 1px dashed&quot; width=400 height=400&gt;&lt;br /&gt;&lt;br /&gt;I did have to add two new columns (B and&lt;br /&gt;C)... there's just no way around it, but&lt;br /&gt;once I worked out the formulas, it wasn't&lt;br /&gt;very complicated at all, and I got the exact&lt;br /&gt;results I was looking for.&lt;br /&gt;&lt;br /&gt;Here is the formula for column B:&lt;br /&gt;=INDIRECT(&quot;A&quot;&amp;ROW() - ((IF(MOD(ROW()-4,7)=0,&lt;br /&gt;7, MOD(ROW()-4,7)))-1))&lt;br /&gt;&lt;br /&gt;Here is the formula for column C:&lt;br /&gt;=(IF(MOD(ROW()-4,7)=0, 7, MOD(ROW()-4,7)))&lt;br /&gt;&lt;br /&gt;Obviously, adjust the formulas if you're&lt;br /&gt;using different columns.&lt;br /&gt;Also, my list starts at row 5, and each&lt;br /&gt;group is 7 rows deep. So if your list starts&lt;br /&gt;at a different row, replace all the 4's in&lt;br /&gt;the formulas with your starting row MINUS&lt;br /&gt;ONE.&lt;br /&gt;And if your number of rows making up each&lt;br /&gt;group is more/less than 7, then change all&lt;br /&gt;the 7's with your number of rows making up&lt;br /&gt;each group to be sorted. Your list can start&lt;br /&gt;on any row (assuming you change the formulas&lt;br /&gt;accordingly), and all the groups can be any&lt;br /&gt;number of rows each, BUT EACH GROUP MUST BE&lt;br /&gt;MADE UP OF THE SAME COUNT OF ROWS.&lt;br /&gt;&lt;br /&gt;The formula for column B calculates the row&lt;br /&gt;that is the first row of any particular&lt;br /&gt;group, and pulls its column A value into&lt;br /&gt;each column B cell.&lt;br /&gt;&lt;br /&gt;The formula for column C just calculates&lt;br /&gt;which row of 7 that particular row appears&lt;br /&gt;in.&lt;br /&gt;&lt;br /&gt;Paste these formulas into columns B and C of&lt;br /&gt;the first row of the first group in the&lt;br /&gt;list, and then using Excel's Home &gt; Editing&gt;&lt;br /&gt;Fill, copy them DOWN to the rest of the&lt;br /&gt;column B/C rows/cells.&lt;br /&gt;&lt;br /&gt;Finally, to sort the list, use the Data &gt;&lt;br /&gt;Sort function, and make the dialog box that&lt;br /&gt;pops-up, look like this:&lt;br /&gt;&lt;br /&gt;&lt;img src=&quot;http://www.jamesraposa.com/images/mnemonic-list-screenshot3-2026-01-12 214122.png&quot; style=&quot;border: 1px dashed&quot; width=400 height=250&gt;&lt;br /&gt;&lt;br /&gt;Before actually sorting the list (i.e.&lt;br /&gt;clicking the dialogue box's &quot;OK&quot; button),&lt;br /&gt;make sure to set the &quot;My data has headers&quot;&lt;br /&gt;checkbox accordingly, and click the &quot;Sort &gt;&lt;br /&gt;Options...&quot; tab to set the &quot;Sort top to&lt;br /&gt;bottom&quot; radio button as well.&lt;br /&gt;&lt;br /&gt;Click &quot;OK&quot;, and you should end up with&lt;br /&gt;something similar to what's showing in the&lt;br /&gt;second image above.&lt;br /&gt;&lt;br /&gt;Once you're done copy all of column A, and&lt;br /&gt;paste it into your original text file, or&lt;br /&gt;just name the spreadsheet, save it, and use&lt;br /&gt;it instead.&lt;br /&gt;&lt;br /&gt;Use the comments if you have any questions&lt;br /&gt;or issues to report.&lt;br /&gt;&lt;br /&gt;Hope this helps, and thanks for reading.</description>
  </item>
  </channel>
</rss>