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

rishijain11

Board Regular
Joined
Mar 29, 2006
Messages
163
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
 

Some videos you may like

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.

Eric W

MrExcel MVP
Joined
Aug 18, 2015
Messages
9,886
Try:

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

<colgroup><col style="width: 25pxpx"><col><col><col><col><col></colgroup><thead>
</thead><tbody>
</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)))

<thead>
</thead><tbody>
</tbody>

<tbody>
</tbody>
 

rishijain11

Board Regular
Joined
Mar 29, 2006
Messages
163
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
Joined
Aug 18, 2015
Messages
9,886
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))))
 

Watch MrExcel Video

Forum statistics

Threads
1,102,002
Messages
5,484,127
Members
407,431
Latest member
kalvinswisher

This Week's Hot Topics

  • Finding issue in If elseif else with For each Loop
    Finding issue in If elseif else with For each Loop I have tried this below code but i'm getting in Y column filled with W005. Colud you please...
  • MsgBox Error
    Hi Guys, I have the below error show up when i try and run my macro in File1 but works fine if i copy and paste the same code into file2. [ATTACH...
  • CELL FORMAT - IF CONDITION
    My Cell Format is [B]""0.00" Cr". [/B]But in the cell, it is showing 123.00 for editing. (123 is entry figure). (Data imported from other...
  • Show numbers nearly the same
    Is this possible. I have a number that can change very time eg 0.00001234 Then I have a lot of numbers 0.0000001, 0.0000002, 0.00000004...
  • Please i need your help to create formula
    I need a formula in cell B8 to do this >>if b1=1 then multiply ( cell b8) by 10% ,if b1=2 multiply by 20%,if=3 multiply by 30%. Thank you in...
  • Got error while adding column and filter
    Got error while adding column and filter In column Z has some like "Success" and "Error". I want to add column in AA if the Z cell value is...
Top