Sort the complete worksheet data range first by Adm Date and then by Prim Cvg, using Excel’s multilevel Sort dialog so every patient row stays together.
Sort the worksheet
- Save a backup copy first if you may need the current row order.
- Click any cell inside the data.
- If completely blank rows or columns divide the data, select the entire rectangular range manually, including all headers and rows.
- Do not select only the
Adm Date or Prim Cvg column.
- Select Data → Sort.
- Ensure My data has headers is selected. The dropdowns should display names such as
Adm Date rather than column letters.
- Configure the first level:
- Sort by:
Adm Date
- Sort On:
Cell Values
- Order:
Oldest to Newest
Use Newest to Oldest instead if the most recent admissions should appear first.
- Select Add Level.
- Configure the second level:
- Then by:
Prim Cvg
- Sort On:
Cell Values
- Order:
A to Z
- Confirm that Adm Date is above Prim Cvg in the list, and then select OK.
Excel applies sort levels from top to bottom. The result is one worksheet arranged by admission date, with rows sharing the same date ordered alphabetically by primary coverage. Blank cells are placed last by Excel’s standard sort order.^1^
If the dates do not sort correctly
The Adm Date values must be real Excel dates, not text. A likely sign of text-formatted dates is that dates appear in an unexpected sequence instead of chronological order. Convert those entries to Excel dates, then repeat the multilevel sort.^1^
If the result is wrong immediately after sorting, press Ctrl+Z before making or saving other changes.
References
- Windows (#tab/windows)