Excel Formula : Duplicate Multi condition

chandrashekar

Well-known Member
Joined
Jul 15, 2005
Messages
529
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.


[TABLE="width: 472"]
<colgroup><col><col><col><col></colgroup><tbody>[TR]
[TD]BN[/TD]
[TD]LDC[/TD]
[TD]Formula1(Need Formula)[/TD]
[TD]Output value[/TD]
[/TR]
[TR]
[TD]CPI[/TD]
[TD]A[/TD]
[TD] [/TD]
[TD]Yes[/TD]
[/TR]
[TR]
[TD]CPI[/TD]
[TD]B[/TD]
[TD] [/TD]
[TD]Yes[/TD]
[/TR]
[TR]
[TD]CPI[/TD]
[TD]B[/TD]
[TD] [/TD]
[TD]Yes[/TD]
[/TR]
[TR]
[TD]CPI1[/TD]
[TD]A[/TD]
[TD] [/TD]
[TD]No[/TD]
[/TR]
</tbody>[/TABLE]

Regards,

Chandru
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
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,223,911
Messages
6,175,324
Members
452,635
Latest member
laura12345

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