• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User


  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Add different values in a column to another list of values


New Member

I would like your help. I usually need to match specific values from one column to a list in another. Usually I do it manually by copy pasting, but would love to know how to do it with a formula.

A simple example is:

What formula can I use to do this?



  • upload_2016-5-20_15-32-11.png
    28.3 KB · Views: 7
Something like below?

Assuming each set of Text1~Text6 will have distinct match. You will need to extend formula as needed.
4th set will need something like...

Or you can set it up with index# for list of matches and use something like...

See attached.


  • Choose_Countif.xlsb
    8.8 KB · Views: 5
Oh wait. You can shorten second version to something like. No need for index#.

To make it dynamic use named range.

Formula becomes...


  • NamedRange_Index.xlsb
    9.2 KB · Views: 5
Hi Chihiro,

Thank you very much for your quick answer.

I tried your formulas and really like that -
=CHOOSE(COUNTIF($A$1:A2,A2),$D$2,$D$3,$D$4) and =INDEX(lstMatch,COUNTIF($A$1:$A2,A2))

I'm sure I'm going to use them a lot.

Now, what do you recommend when we have the 2 lists as unique values and we want to have the 2 columns as mentioned before? The formulas you mention work when the one of the lists have the right rows already. So, when I have the 2 unique lists and want to match them and create the equivalent columns, what is possible to do? The results don't need to have a specific order as long as the combination of list 1 to all elements of list 2 (or other way around) are there.




  • joining lists.xlsx
    9 KB · Views: 5
In that case, there's 2 ways of doing it.

1. Formula method. See link for details.

2. Use MS Query to produce Cartesian Product Join of 2 list

My preferred method is 2. There's few steps involved here.

1. Create 2 sheets in the workbook. Each containing 1 of the list and covert the list to table. Lets call each sheet List1 and List2. Save the file.

2. Go to Data tab in ribbon tool and find "Get External Data"->"From Other Sources"->"From Microsoft Query"

3. Choose "Excel Files" and click ok.

4. Navigate and select the file saved in step 1 and hit ok.

5. You should see something like below. If not, click on Options and check "System Tables".

6. Expand List1$ & List2$ and move over columns (list to match 1, list to match 2) over to right. Then hit "Cancel".

7. Popup window will appear, click "Yes".

8. You should see table populated. Click on "File" and "Return Data to Microsoft Excel".

9. Choose where you want to return the data. See attached for end result.


  • joining lists.xlsx
    15.1 KB · Views: 13