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
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
Why do you have oki in col D as it exists in col C but not in B, which is the opposite of what you said.
 
Upvote 0
I have the impression from the desired results, that you want an exclusive OR, that is, it's good if it's in column B or column C, but not both or neither.

MrExcelPlayground4.xlsx
ABCD
1trertpplrtre
2plrplrplr 
3okitreokioki
4lpomngfre 
Sheet23
Cell Formulas
RangeFormula
D1:D4D1=IF(XOR(OR(NOT(ISERROR(MATCH($B$1:$B$4,A1,0)))),OR(NOT(ISERROR(MATCH($C$1:$C$4,A1,0))))),A1,"")
 
Upvote 0
If what you said is true, and you just have an error in your example, and "oki" should NOT show up, then if your data begins in row 1, place this in cell D1 and copy down for all rows:
Excel Formula:
=IF(AND(COUNTIF(B:B,A1)>0,COUNTIF(C:C,A1)=0),A1,"")
 
Upvote 0
or
Excel Formula:
=IF(CONCAT(--(A1=B1:C1))="10",A1,"")
 
Upvote 0
If you want one or the other but not both
+Fluff 1.xlsm
ABCD
1
2TrertpplrTre
3plrplrplr 
4okitreokioki
5lpomngfre 
Main
Cell Formulas
RangeFormula
D2:D5D2=IF(XOR(COUNTIFS($B$2:$B$5,A2),COUNTIFS($C$2:$C$5,A2)),A2,"")
 
Upvote 0
@JEC have you actually tried that? As it will just return blank for each row. ;)
 
Upvote 0
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
I actually don't see how these examples fit the question

How is D2 "Tre"
 
Upvote 0
I compared per rowo_O Thats why,time to sleep
 
Upvote 0

Forum statistics

Threads
1,223,214
Messages
6,170,774
Members
452,353
Latest member
strainu

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