Solved

# Sorting multiple rows and columns, and count duplicates in Excel 2013

Posted on 2016-11-03
51 Views
Hi Experts,

I'm working in Excel spreadsheet exported from a Sharepoint survey solution. The spreadsheet contains names of the people from the survey in a table.

There are multiple duplicates in various cells within this table.

I am trying to do the following:

1. Sort the names in Alphabetical order
2. Count the number of names
3. A tally of Names with number of duplicates (if possible)

Is there a tool or formula that I can use to achieve this? A sample of input data and also what I would like to achieve as an output is attached.

input.jpg
output.jpg
0
Question by:alexkim
• 2

LVL 28

Accepted Solution

Subodh Tiwari (Neeraj) earned 500 total points
ID: 41873421
Please find the attached with the code on Module1 and a button on Sheet2.
You may click the button on Sheet2 to get the Names from Sheet1 and their count on Sheet2 in alphabetical order.

If sheet names are different from Sheet1 and Sheet2, change them in the code. The code assumes that the Sheet1 is the sheet with raw data and Sheet2 is the output sheet.
NamesAndTheirCount.xlsm
0

LVL 92

Expert Comment

ID: 41874781
For a non-code solution, I'd use a PivotTable:
1) Copy and paste your responses into a single column.  Make sure that data has a column header, such as "Name"
2) Create a PivotTable based on that, with Name as a Row field, and Count of Name as a Value field
3) Sort the PivotTable on the Name column
1

Author Comment

ID: 41876367
Thank you Subodh, this is the exact solution I was looking for - you have just made my day!!
0

LVL 28

Expert Comment

ID: 41876593
You're welcome Alex! Glad to help.
0

## Featured Post

### Suggested Solutions

This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
Outlook Free & Paid Tools
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calculâ€¦
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.