Generating a List of Customers and Transaction Dates

Written by Allen Wyatt (last updated November 8, 2025)
This tip applies to Excel 2007, 2010, 2013, 2016, 2019, 2021, 2024, and Excel in Microsoft 365


Brenda has a worksheet that contains customer transaction information from the past 18 months. The data requires many rows and columns. Using this data as the source, she needs to generate a list of customer names (from column A) and transaction dates (from column D) that are unique. Thus, a customer could easily appear multiple times in the generated list, but never would the same customer appear more than once on the same date.

As with many tasks in Excel, the program provides multiple ways that you can get what you want. For the first approach, I'm going to assume that Brenda is using Microsoft 365. In that case, you could use the UNIQUE function after combining the contents of columns A and D, in this manner:

=UNIQUE(A2:A3000 &" " & TEXT(D2:D3000,"mm/dd/yy"))

This formula assumes that your data starts in row 2 and doesn't extend more than 3,000 rows. The result is a single column of text values where the name and date are combined. The drawback to this simple approach, though, is that the results are combined into a single column. If you want separate columns, then you can add the FILTER function into the mix:

=UNIQUE(FILTER(CHOOSE({1,2},A2:A3000,D2:D3000),(A2:A3000<>"")*(D2:D3000<>"")))

This formula is a good deal longer, but it provides more usable results. You end up with two columns consisting of the names and transaction dates. You will, however, need to add date formatting to the second column that is generated.

If you want a shorter formula, you can rely on the HSTACK function, which returns a horizontal "stack" (array) of values:

=UNIQUE(HSTACK(A1:A3000,D1:D3000))

You end up with two columns (the names and the transaction dates), plus it returns the column headers. You will need to apply date formatting to the second returned column, as well. To my mind, you can make the formula even better by throwing the TRIMRANGE function into the mix:

=UNIQUE(HSTACK(TRIMRANGE(A:A),TRIMRANGE(D:D)))

Now it doesn't matter how many rows you use in your data, the formula will return the unique combination of names and transaction dates that Brenda wants.

If Brenda is using an older version of Excel, then one quick way to get the desired list is to make a copy of the worksheet and, within the copy, use Remove Duplicates. Select a cell in your data, display the Data tab of the ribbon, and click the Remove Duplicates tool. Excel displays the Remove Duplicates dialog box where you can select which columns should be used to determine duplicate rows. Make sure that the Name and Date columns are the only ones selected, then click OK. You can then delete any unnecessary columns and you are left with the data you want.

Still another approach is to use a PivotTable. Select a cell within your original data and then, on the Insert tab of the ribbon, click the PivotTable tool. In the resulting PivotTable, add both the Name and Date fields to the Rows box, and you end up with a list of unique dates sorted by name.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (8731) applies to Microsoft Excel 2007, 2010, 2013, 2016, 2019, 2021, 2024, and Excel in Microsoft 365.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Turning Off Error Checking

A little green triangle in the corner of a cell means that Excel thinks there is an error with the cell contents. If ...

Discover More

Clearing the Print Area

Excel allows you to specify which portions of a worksheet should be printed when you send output to your printer. If you ...

Discover More

Typing Check Marks into Excel

Need to enter a check mark into a cell? There are a number of ways you can get the desired character, depending on the ...

Discover More

Create Custom Apps with VBA! Discover how to extend the capabilities of Office 365 applications with VBA programming. Written in clear terms and understandable language, the book includes systematic tutorials and contains both intermediate and advanced content for experienced VB developers. Designed to be comprehensive, the book addresses not just one Office application, but the entire Office suite. Check out Mastering VBA for Microsoft Office 365 today!

More ExcelTips (ribbon)

Deleting Duplicate Text Values

Got a list of data from which you want to delete duplicates? There are a couple of techniques you can use to get rid of ...

Discover More

Hiding Rows Based on Two Values

It's easy to use filtering to hide rows based on the value in a cell, but how do you hide rows based on the values in two ...

Discover More

Quickly Adding Formulas Referencing Multiple Worksheets

When you need to pull information from a lot of different worksheets into a single worksheet, it can be baffling to ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] (all 7 characters, in the sequence shown) in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is 2 + 3?

There are currently no comments for this tip. (Be the first to leave your comment—just use the simple form above!)


This Site

Got a version of Excel that uses the ribbon interface (Excel 2007 or later)? This site is for you! If you use an earlier version of Excel, visit our ExcelTips site focusing on the menu interface.

Newest Tips
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.