Excel Formula to find Unique values from Data Table

b bb 6 Reputation points
2021-07-22T16:45:05.573+00:00

Thank you for taking the time to read my question.

I have a data table with many customers. Each customer has many sites. I'm wondering if it's possible to use Excel formulas to return the unique list of sites based on the Customer name entered into a cell. Next I'd like to be able to show the unique values horizontally.

Is this possible or do I need to write a quick macro?

Data Table:

Customer 1 Site 1 Other data
Customer 1 Site 1 Other data
Customer 1 Site 1 Other data
Customer 1 Site 1 Other data
Customer 1 Site 1 Other data
Customer 1 Site 2 Other data
Customer 1 Site 2 Other data
Customer 1 Site 2 Other data
Customer 1 Site 2 Other data
Customer 1 Site 3 Other data
Customer 2 Site A Other data
Customer 2 Site A Other data
Customer 2 Site B Other data
Customer 2 Site B Other data

User Input: Customer 1

Result I'd like to see

    A           B         C

1| Site 1 | Site 2 | Site 3

I found the Unique() function but I need to pass it a range of cells and I'm not sure how to do that. I also found the Transpose() function which I thought I could put the Unique() function in.

=Transpose(Unique("The range I'm not sure how to pass",True,True))

Thanks

Microsoft 365 and Office Excel For business Windows
{count} votes

1 answer

Sort by: Most helpful
  1. Viki Ji_MSFT 4,471 Reputation points
    2021-07-23T07:55:30.77+00:00

    @b bb ,
    Welcome to Q&A forum!

    Please check whether the following formula is helpful to you, since it is an array formula, please press Ctrl+Shift+Enter to check after typing.
    For more information about INDEX: INDEX function.

    =IFERROR(INDEX($B$2:$B$15,MATCH(0,IF($D2=$A$2:$A$15,COUNTIF($D2:D2,$B$2:$B$15),""),0)),"")  
    

    117344-image.png

    Any updates, please let me know.


    If an Answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.