Others

How to Rank Candidates by Votes in Microsoft Access

John WilsonJohn Wilson Nov 20, 2026 869 views

Question details

Rank candidate records by vote total, with the highest totals receiving the best rank.

How to Rank Candidates by Votes in Microsoft Access
Product
Microsoft Access
Device & OS
not provided
Scenario
A candidate list contains a Votes Garnered field that needs to be ranked in a query.
Observed behavior
Microsoft Access does not provide a native RANK function for query results.
Before you start

Identify the candidate table and confirm that Votes Garnered is a numeric field. The example excludes records with null vote totals; enter zero for candidates with no votes if they should be ranked.

Solution 1Recommended

Rank vote totals with a correlated subquery

Use an Access SQL query to give the highest vote total rank 1 and assign the same rank to ties.

The subquery counts records with a higher vote total than the current record, then adds 1. Tied records receive the same rank, and the next rank has a gap: for example, 1, 1, 3.

1
Open SQL View

In Access, select Create > Query Design, then switch to View > SQL View.

2
Enter the ranking query

Enter: SELECT T.*, 1 + (SELECT Count(*) FROM Candidates AS D WHERE D.[Votes Garnered] > T.[Votes Garnered]) AS VoteRank FROM Candidates AS T WHERE T.[Votes Garnered] Is Not Null ORDER BY T.[Votes Garnered] DESC;

3
Use your table name

Replace both occurrences of Candidates with your actual table name. Enclose the name in square brackets if it contains spaces, and update [Votes Garnered] if your field has a different name.

4
Run the query

Select Run to display the records in descending vote order with their VoteRank values.

Rank vote totals with a correlated subquery
Rank lowest totals first: For ascending ranking, change > to < in the subquery and change DESC to ASC in the ORDER BY clause.
Free Microsoft Office alternative

Review exported candidate results in WPS Spreadsheets

WPS Office is a free, lightweight alternative with a familiar interface and Microsoft Office format compatibility for an easy transition. Export Access results to Excel to review them in WPS Spreadsheets; WPS does not run Access database queries.

Sort and review exported candidate vote totals in a spreadsheetOpen and edit Microsoft Excel XLSX and XLS filesUse a familiar spreadsheet interface for a smoother transitionWork with a free, lightweight office suite
microsoft office alternative - wps office

Frequently Asked Questions

Why do tied candidates have the same rank?

The subquery counts only records with a strictly greater vote total. Candidates with equal totals therefore have the same number of records ahead of them and receive the same rank.

Why are there gaps in the ranks after a tie?

The query uses competition ranking: if two candidates are tied at rank 1, the next candidate is rank 3 because two records have higher vote totals.

How do I rank the lowest vote total first?

In SQL View, change the subquery comparison from > to < and change ORDER BY T.[Votes Garnered] DESC to ORDER BY T.[Votes Garnered] ASC.

What happens to candidates with no vote total entered?

The example excludes null values using WHERE T.[Votes Garnered] Is Not Null. Enter 0 in the table for candidates who should be included with no votes.

Can I open the results in WPS Office?

Run the query in Access and use External Data > Excel to export its results. You can then open the exported Excel file in WPS Spreadsheets; WPS does not execute the Access query.