Compare Cell A to see if value is either in one column or both

topswim

Board Regular
Joined
May 14, 2002
Messages
133
Office Version
  1. 365
Platform
  1. Windows
I am to looking at value in A column and see if it's in only column B, but not in column C. If it's true (in column B only) then I want to enter cell A value in column D otherwise blank

A B C D (desired result from above)
TrertpplrTre
plrplrplrblank
okitreokioki
lpomngfreblank
 
Sorry. Let me clarify a little better as I needed to add one more column (see below). Also, it is not case sensitive so should not be relevant JEC.

Thank you for the responses though
 

Attachments

  • Compare.png
    Compare.png
    12.2 KB · Views: 4
Upvote 0

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
Ok, how about
+Fluff 1.xlsm
ABCDE
1
2TrertpplrTre 
3plrplrplr  
4okitreoki oki
5lpomngfre  
Main
Cell Formulas
RangeFormula
D2:D5D2=IF(AND(COUNTIFS($B$2:$B$5,A2),COUNTIFS($C$2:$C$5,A2)=0),A2,"")
E2:E5E2=IF(AND(COUNTIFS($B$2:$B$5,A2)=0,COUNTIFS($C$2:$C$5,A2)),A2,"")
 
Upvote 0
Solution
And to follow up on my original post, in light of the recent update, this would go in cell D2:
Excel Formula:
=IF(AND(COUNTIF(B:B,A2)>0,COUNTIF(C:C,A2)=0),A2,"")
and copy down.

And this would go in cell E2:
Excel Formula:
=IF(AND(COUNTIF(B:B,A2)=0,COUNTIF(C:C,A2)>0),A2,"")
and copy down.
 
Upvote 0
Ok, how about
+Fluff 1.xlsm
ABCDE
1
2TrertpplrTre 
3plrplrplr  
4okitreoki oki
5lpomngfre  
Main
Cell Formulas
RangeFormula
D2:D5D2=IF(AND(COUNTIFS($B$2:$B$5,A2),COUNTIFS($C$2:$C$5,A2)=0),A2,"")
E2:E5E2=IF(AND(COUNTIFS($B$2:$B$5,A2)=0,COUNTIFS($C$2:$C$5,A2)),A2,"")
Thank you again Fluff. That worked
 
Upvote 0
Glad we could help & thanks for the feedback.
 
Upvote 0
Ok, how about
+Fluff 1.xlsm
ABCDE
1
2TrertpplrTre 
3plrplrplr  
4okitreoki oki
5lpomngfre  
Main
Cell Formulas
RangeFormula
D2:D5D2=IF(AND(COUNTIFS($B$2:$B$5,A2),COUNTIFS($C$2:$C$5,A2)=0),A2,"")
E2:E5E2=IF(AND(COUNTIFS($B$2:$B$5,A2)=0,COUNTIFS($C$2:$C$5,A2)),A2,"")
Quick question. What if one of the cells is blank in a column? I am seeing I have some that are in column B, but column C is blank
 
Upvote 0
Blank cells shouldn't make a difference.
 
Upvote 0
In that case can you post some sample data that shows the problem?

MrExcel has a tool called “XL2BB” that lets you post samples of your data that will allow us to copy/paste it to our Excel spreadsheets, so we can work with the same copy of data that you are. Instructions on using this tool can be found here: XL2BB Add-in

Note that there is also a "Test Here” forum on this board. This is a place where you can test using this tool (or any other posting techniques that you want to test) before trying to use those tools in your actual posts.
 
Upvote 0

Forum statistics

Threads
1,217,302
Messages
6,135,724
Members
449,959
Latest member
choy96

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