How to compare 2 columns in excel - excel

I have Column A and Column B. What I want to do is copy Column C and remove rows which match/contain rows in Column B.
I have this formula but it doesn't remove containing rows, only matching:
=ARRAYFORMULA(IF(ISNA(MATCH(A:A,B:B,0)),A:A,""))
Any formula/query for this?
You can see it live here (please comment suggestion there): https://docs.google.com/spreadsheets/d/1EBJgRAt0UfyfP_zgv3RITNnN3VW3KXoeiIC9mDTjJL4/edit?usp=sharing

If you set the formula in column c row 1 as "=if(a1 = b1,1,0)", then you could just filter on values in column c = 1 and delete those rows. That way when you copy column c to another column or where ever else you are copying the data, you will not get the matching items to copy over.

Excel - Copy column A to C - Highlight columns B & C - Home - Conditional Formatting - Highlight Cells Rules - Duplicate Values - Light Red Fill with Dark Red Text - Sort on pink cell colors for column C - Delete values shaded pink in column C - Done

Related

How to move data from one column to another without overwriting existing values in destination column

I'm hoping this is so simple I'm just over-looking the obvious answer! I want to move the values (pictured) in column A, en-masse, to the blank cells in column B without overwriting the existing values in column B. Note that the data in column B has differing number of rows. Any ideas?
enter image description here
There are a couple of options to do this:
Option 1
Place a filter onto the data
Filter column B for blank values
Enter a formula into B1 that is =A1
Drag this down to the bottom of your cells
Set the filter for all values
Select the whole of column B
Copy and Paste the data as values
Option 2
Create a new column after B
In this column enter the following formula - =IF(B1="",A1,B1)
Drag this down to the bottom of your data
Select the whole of column B
Copy and Paste the data as values
Delete column B
Column C then becomes column B
I knew I was missing something...Copy Column A, highlight column B, 'Paste special', tick 'Skip blanks' checkbox and done! Many thanks for reading.

Search the Alphanumeric values from column C's each cell in column D's each cell if found mark/highlight in column D or column E

Search alphanumeric serial numbers from column C's every row in column D, which is having a string in each row and after finding give some mark to that row(eg. highlight with color)
Give some type of highlight to column D where serial number matched with column C.
Column C has more than 8000 entries and column D has around 2500 entries.
EXAMPLE
Using Conditional Formatting I'm using the following formula
=IFERROR(FIND($C1,$D1),-1)>0
and formatted it to fill with a colour if True
or even better you can use the formula from #Plutian below which will ignore where both cells in columns C and D are blank
=SUMPRODUCT(--ISNUMBER(SEARCH($C1,$D1)))>0
I've then applied it to the range I want it to work on
Giving the following results
Update after comments:
For column C use the following conditional formatting formula
=IFNA(MATCH("*"&C1&"*",$D$1:$D$3,0),-1)>0
and for column D use
=SUMPRODUCT(COUNTIF(D1,"*"&$C$1:$C$3&"*"))>0
Giving:

Is there a formula to line up column rows based on cell value or partial value?

I have a sheet with 4 columns, see screenshot_1
Column A - word
Column C - word (column A) + extra word
The rows of Column A and column C and their values (column B and D) are not lined up. As you can see in the screenshot,
I want to place C2 And D2 on line 29, C3 and D3 on line 15, etc. So column C and D are filled with the matching word of column A (if it exists).
Resulting in something like screenshot_2
Is there a formula to line up column rows based on cell value or partial value?
Screenshot 1
Screenshot 2
You can achieve this by using wildcard in Vlookup. Enter this formula =VLOOKUP("*"&A2&"*",$F$2:$G$26,2,FALSE) in column C.
Possibly the easiest solution would be to keep columns A and B untouched, and have column C automatically display "used (whatever)" if column D contains a number.
To accomplish this, type the following formula into cell C2 and drag down:
= IF(ISNUMBER(D2),"used "&A2,"")
First, separate the ranges with some empty columns; so column A & is the same, C is empty, D & E are a not connected
Create a new column in the empty C column:
=IFERROR(IF(MATCH("*"&A2&"*",F:F,0),VLOOKUP("*"&A2&"*",F:G,2,0),""),"")
See this Example

Excel: Find duplicates in column with differences in another column

I want to highlight cells in column A, which have duplicates in column A but a difference in column B.
A B
1 2 -
2 3 +
3 2 -
2 4 +
1 2 -
3 2 -
4 5 -
The rows (or a cell within the row) with the - shall not be highlighted, but the rows (or a cell within the row) with the + shall be highlighted.
How can I accomplish this in an Excel formula?
Please pay attention to the fact, that not all unique combinations shall be highlighted (last row!).
In SQL the corresponding query would be something like this:
SELECT *
FROM table
GROUP BY A
HAVING COUNT(B) > 1
A simpler solution might be to use Concatenate to join A and B together and use a conditional formating to highlight the unique values. This would leave your desired list highlighted:
For the Conditional Formatting highlight column C then navigate:
Home-> Conditional Formatting -> New Rule-> Format only unique or duplicate values
Then change selection from "duplicate" to "unique" and select the desired format. Apply the setting and have identified the appropriate rows.
Assuming your data is in A1:B7, (with "A" and "B" as headers on row 1):
I used the following formulas to get the matches ..
I just did a simple search after, and before .. if it finds a record above or below, it "flags" it in column F as TRUE.
Not sure it works for 3 or more duplicates, though you didn't seem to indicate how you wanted a 3 of a kind to work ;)
D2=MATCH(A2,A3:$A$1000,0)
E2=IF(ISERROR(D2),IF(ISERROR(G2),"",OFFSET($A$1,G2,0,1,1)),OFFSET(B2,D2,0,1,1))
F2=AND(NOT(AND(ISERROR(D2),ISERROR(G2))),B2<>E2)
G2=MATCH(A2,$A$1:A1,0)`
D col locates the first matching A column after the current row.
G col locates the first matching A Column prior to current row.
E col pulls that remote B column value to current row to more easily check.
F col puts the logic together: If we found something, and B cols are not equal.
Here is another way to do it assuming your above data is in cells A2:B7:
1) Copy and paste your column A values to a blank section of your workbook(Lets say A11) and perform the following function Data->Remove Duplicates with the section selected.
2) Highlight cells B10:B13(all cells where a value is in column A) and type in the following formula:
=FREQUENCY(A2:A8,A10:A13)
Hit Ctrl + Shift + Enter to make this an array.
3) Similar to step two highlight all cells in column C where there is data in columns A and B. In this case C2:C7 and use the following formula:
=IF(VLOOKUP(A2,$A$10:$B$13,2,FALSE)>1,IF(FREQUENCY(VALUE(CONCATENATE($A$2:$A$7,$B$2:$B$7)),VALUE(CONCATENATE($A$2:$A$7,$B$2:$B$7)))<>1,"","Highlight"),"")
Hit Ctrl + Shift + Enter to make this an array.
Your cells that need to be highlighted will now say "Highlight"

Highlighting a cell in one column when matching value found anywhere in a second column

Column B is where data is going to be entered.
Column I has a list of data that is predefined.
I want column I's data to be highlighted when the data is found anywhere in column B. Example:
A B C D E F G H I J
---------------------------------------------
3 1
2 2
7 3
So the cells in column I containing 2 and 3 would be highlighted because found in Column B at some point.
Please try selecting ColumnI, HOME > Styles - Conditional Formatting - New Rule..., Use a formula to determine which cells to format, Format values where this formula is true:
=COUNTIF(B:B,I1)>0
choose your formatting, OK, OK.
Use conditional formating with
=isna(match($i1,$b$1:$b$3,0))
as the condition for cells that don't match (the zero is important as it means exact matches only)
... but
=countif($b$1:$b$3,$i1)=0
will do the same thing, while
=countif($b$1:$b$3,$i1)>0
is a condition for matches

Resources