Excel Formula : Duplicate Multi condition

chandrashekar

Well-known Member
Joined
Jul 15, 2005
Messages
517
Office Version
  1. 365
Platform
  1. Windows
Hello,

Need formula which should check Column A and B For Ex: If CPI have both A & B then its Yes. IF CPI has only A or B then it should be No.


BNLDCFormula1(Need Formula)Output value
CPIA Yes
CPIB Yes
CPIB Yes
CPI1A No

<colgroup><col><col><col><col></colgroup><tbody>
</tbody>

Regards,

Chandru
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
In C2 control+shift+enter, not just enter, and copy down:

=SUM(IF(FREQUENCY(IF($B$2:$B$5<>"",IF($A$2:$A$5=A2,MATCH($B$2:$B$5,$B$2:$B$5,0))),ROW($B$2:$B$5)-ROW($B$2)+1),1))=SUM(IF(FREQUENCY(IF($B$2:$B$5<>"",MATCH($B$2:$B$5,$B$2:$B$5,0)),ROW($B$2:$B$5)-ROW($B$2)+1),1))

This delivers TRUE which can be read as Yes.
 
Upvote 0
Assuming BN is in column A, LDC is in column, and you want your Yes/No values in column C, enter this formula in cell C2 and copy down:
Code:
=IF(AND(COUNTIFS(A:A,A2,B:B,"A")>0,COUNTIFS(A:A,A2,B:B,"B")>0),"Yes","No")
 
Upvote 0
With your sample data in A1:C5
Either of these regular formulas, copied down, can be used to return the values you're looking for:
Code:
C2: =IF(SUMPRODUCT(--(COUNTIFS($A$2:$A$5,A2,$B$2:$B$5,{"A","B"})>0))=2,"Yes","No")
or...if you're the kind of person who references entire columns...
Code:
C2: =IF(SUMPRODUCT(--(COUNTIFS($A:$A,A2,$B:$B,{"A","B"})>0))=2,"Yes","No")
Is that something you can work with?
 
Upvote 0

Forum statistics

Threads
1,215,603
Messages
6,125,776
Members
449,259
Latest member
rehanahmadawan

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top