# how to find if any unique values in two columns for each value in one column

#### rishijain11

##### Board Regular
I have two columns. column A has text, column B has a numeric ID.

A B
Pizza 40
Candy 20
Soda 30
Broccoli 20
Pizza 40

Every time "40" appears in column B, I want to make sure that all the respective values for 40 in column A, are the same. In this case, they're all "Pizza".

I want to know if there are ever any multiple unique values. In this case, "20" has two unique values - "Candy" and "Broccoli".

How can I do this without having a formula that I would need to drag down all throughout a new column.

Ideally, I'd like to be able to have just 4 cells for 4 formulas (one for each unique numeric code). is this possible?

hope this was clear

### Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.

#### Eric W

##### MrExcel MVP
Try:

ABCDE
1FoodValueValuesAll the same?
2Pizza4010TRUE
3Candy2020FALSE
4Soda3030TRUE
5Broccoli2040TRUE
6Pizza40

</tbody>
Sheet6

Worksheet Formulas
CellFormula
E2=COUNTIF(\$B\$2:\$B\$6,D2)=COUNTIFS(\$B\$2:\$B\$6,D2,\$A\$2:\$A\$6,INDEX(\$A\$2:\$A\$6,MATCH(D2,\$B\$2:\$B\$6,0)))

</tbody>

<tbody>
</tbody>

#### rishijain11

##### Board Regular
perfect. thanks Eric.

In the case of column D, value "10". Since this doesn't exist in column B, is there a way I can have it return text other than "true"

#### Eric W

##### MrExcel MVP
Try:

=IF(COUNTIF(\$B\$2:\$B\$6,D2)=0,"None found",COUNTIF(\$B\$2:\$B\$6,D2)=COUNTIFS(\$B\$2:\$B\$6,D2,\$A\$2:\$A\$6,INDEX(\$A\$2:\$A\$6,MATCH(D2,\$B\$2:\$B\$6,0))))

1,106,431
Messages
5,511,300
Members
408,839
Latest member

### This Week's Hot Topics

• Turn fraction around
Hello I need to turn a fraction around, for example I have 1/3 but I need to present as 3/1
• TIme Clock record reformatting to ???
Hello All, I'd like some help formatting this (Tbl-A)(Loaded via Power Query) [ATTACH type="full" width="511px" alt="PQdata.png"]22252[/ATTACH]...
• TextBox Match
hi, I am having a few issues with my code below, what I need it to do is when they enter a value in textbox8 (QTY) either 1,2 or 3 the 3 textboxes...
• Using Large function based on Multiple Criteria
Hello, I can't seem to get a Large formula to work based on two criteria's. I can easily get a oldest value based one value, but I'm struggling...
• Can you check my code please
Hi, Im going round in circles with a Compil Error End With Without With Here is the code [CODE=rich] Private Sub...
• Combining 2 pivot tables into 1 chart
Hello everyone, My question sounds simple but I do not know the answer. I have 2 pivot tables and 2 charts that go with this. However I want to...