Generating a List of Customers and Transaction Dates

Written by Allen Wyatt (last updated November 8, 2025)

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

Specifying Sub-entries in an AutoMark File

An AutoMark file allows you to quickly and easily create an index from a document. This can be a great boon for large ...

Discover More

Resetting Default Character Formatting

If you need to remove any explicit character formatting from some text, you'll want to commit the shortcut in this tip to ...

Discover More

Determining Header Section Overlap in a Macro

When setting a page header for a worksheet, you have three sections you can use. If you put too much information in the ...

Discover More

Professional Development Guidance! Four world-class developers offer start-to-finish guidance for building powerful, robust, and secure applications with Excel. The authors show how to consistently make the right design decisions and make the most of Excel's powerful features. Check out Professional Excel Development today!

More ExcelTips (ribbon)

Address of a Cell in Which a Threshold is Exceeded

If you keep a lot of data in Excel, you may be interested in figuring out when that data surpasses a threshold. This tip ...

Discover More

Returning the Smallest Non-Zero Value

In a series of values, you may need to know the smallest value that isn't a zero. There is no built-in function to do ...

Discover More

Projects in Process for Each Day in a Range of Dates

If you use Excel to track projects on which you are working, you may want to determine how many projects were in-process ...

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 seven more than 1?

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.