Excel 2007 - Compare 2 columns, find matching values - excel-2007

I have two colums. Column A and Column B which have email addresses. Column A has about 3000 rows, Column B has about 1800. Is there anyway to compare the two columns, and find any fields that match...
And if so, how to either highlight or flag them as a match... or shit, for even simplicitys sake, just give me a count of how many matches were found...
Should i try a macro? Or is there a forumula that will help with this?

You could fill the C Column with variations on the following formula:
=IF(ISERROR(MATCH(A1,$B:$B,0)),"",A1)
Then C would only contain values that were in A and C.

=VLOOKUP(lookup_value,table_array,col_index_num,range_lookup) will solve this issue.
This will search for a value in the first column to the left and return the value in the same row from a specific column.

VLOOKUP deosnt work for String literals

Related

How can I use Conditional formatting formula in the filter in the Gsheets to select 2 or more columns where cells that are not empty in both?

so I have ABCDE columns and I want to see rows of the cells that are not empty in the C as well as D column. how do I do this? I know I can have one column do that but that way it would exclude the information in the other column.
Let me know if this doesnt make sense. I'll try to explain with an example
I am a little confused by your question as to whether you are trying to use Conditional Formatting or to create a filter.
If you are trying to use Conditional Formatting:
It sounds like you are trying to highlight a row if there is not a blank cell in column C and not a blank cell in column D of that row.
Create a Conditional Formatting rule with the following:
Apply to Range A1:E1000 <-- (or however many rows of data you have)
Format cells if... SELECT "Custom formula is"
=or(NOT(isblank($C1)),NOT(isblank($D1)))
Formatting style Pick a color to highlight the row
This rule will highlight columns A-E for each row that has data in both column C and column D.

Find value in column, based on 2 criteria

I have a file with 3 columns. Column A contains 300,000 rows, with about 200 separate IDs, all duplicated at least 1,000 times. Column B contains the date for each of the rows. Column C contains the values that I need to extract.
Each of the 200 IDs in Col A can have multiple values (e.g. ID 1234 might have dates 1/1/2001, 1/3/2001, 1/2/2015, etc). Similarly, each date on Col B will have multiple IDs (e.g. 1/2/15 might have IDs of 1234, 1874, 1930, 6043, etc).
In a nutshell, I need to check the values in Col A and Col B to find the relevant ID in Col A and the maximum value in Col B, and return the value in the relevant cell in Col C.
I've looked at Index/Match examples, but they don't seem to be suitable. Is there any suggestions on a macro I could run, that would accomplish what is needed.
Use this array formula:
=INDEX($C$1:$C$300000,MATCH(1,IF(($A$1:$A$300000="1234")*($B$1:$B$300000=MAX(IF($A$1:$A$300000="1234",$B$1:$B$300000))),1,0),0))
Being an array formula it must be confirmed with Ctrl-Shift-Enter instead of Enter when exiting edit mode.
Change the "1234" to a reference cell with the appropriate ID.
You can accomplish this using array formulas. To start, you can retrieve the maximum date in column B when column A is 1234 using the below formula. Keep in mind that you have to use Ctrl-Shift-Enter when you finish typing an array formula.
{=MAX(IF($A$2:$A$24=1234,$B$2:$B$24))}
Note that you will need to change the ranges to include all of your data, rather than my test data on rows 2-24.
Now that you have a formula to retrieve the max date, you can put that inside an index/match and, again using Ctrl-Shift-Enter, use the below array formula to retrieve the value in column C for a row matching 1234 and the maximum date.
{=INDEX($C$2:$C$24,MATCH(1234&MAX(IF($A$2:$A$24=1234,$B$2:$B$24)),$A$2:$A$24&$B$2:$B$24,0))}

VBA to check for blank cells in columns based on value in another column

Given
O 1 2 3 A
A 4 5 6 B
B 7 8 9 D
O 3
C 15
T 18
I'm looking for VBA code to validate that when column A contains a value that the remaining columns also contain values and when it doesn't contain a value, that columns 2 & 5 also contain values but 3 & 4 don't.
I've simplified the example, in a real sheet there will be many more columns and rows to check.
I've considered COUNTIF and INDEX/MATCH and array forumlas but from my understanding these all work on single columns at a time.
I want to do something like WHEN A1:An<>"" THEN COUNTBLANK(B:E) ELSE COUNTA (C:D)
Is the best way to use autofilter using blanks in A and then countblank and then a second autofilter for values in A.
Thanks
You can do it with a couple of nested IF formulae as follows:
=IF(A1<>"",
"A not empty, "&IF(COUNTBLANK(B1:E1)=0,
"B:E not blank",
"B:E have blanks"),
"A blank, "&IF(AND(COUNTBLANK(B1)+COUNTBLANK(E1)=0,
COUNTBLANK(C1)+COUNTBLANK(D1)=2),
"Columns 2&5 have values and Columns 3&4 don't",
"but condition not met"))
The reason for going down the VBA route is that I want a generic reusable function as opposed to a formula I copy between cells and sheets changing the columns etc along the way ending up with a lot of duplicate code.
So something that takes a column to test and a value to test it with. Third parameter would be a range of columns to validate, and the fourth parameter the validation.
I don't want any solution to have the columns hard coded and I don't want intermediate totals at the end of rows. This is fairly easily achieved in Excel itself...
The reason for trying to use countblank is that I can apply it to a range.
After a lot of searching I discovered this (the columns don't match the original example)
=SUMPRODUCT((A2:A19<>"")*(B2:D19=""))
=SUMPRODUCT((A2:A19="")*(D2:D19=""))
=SUMPRODUCT((A2:A19="")*(B2:C19<>""))
Nice huh? I just need to convert it into VBA now.
Thanks

Issue with Array in Vlookup [Excel 2007]

I have an issue with vlookup recently when trying to compare 2 tables.
it seems that no matter what i did the end result is always "#N/A"
My goal is to find out the if the overlapping entry in both table via vlookup.
My sample in is this link, can any one help?
http://goo.gl/dvWGm
Many thanks in advance!
N/A means that the value in column A is not present in column D, in your case none of the values in column A are present in column D.
Try to copy a value from column A and paste it to column D and you'll see that N/A turns into that value.

Excel 2007 several columns with different values, find where which number is

I Have 6 columns where I have up to 320 values. I say up to because the number of values differ in each column and the values also differ in the columns.
Like this:
Column A has the following values, one in each cell: 1,2,3,4,6,8,9
Column B has the following values, one in each cell: 1,3,4,6,7,8,10
etc.
I would like to know what numbers that differ between the columns, so I would like to know that 2 is missing in the B column and that 9 is missing from the A column.
Optimal would be if it were possible to have one line for each number and when there is missing I just get a blank cell on that line in that specific column.
Keep in mind that there are 6 columns.
Is this possible? Is there a workaround?
I would prefer to do this in Excel but I can use other solutions as well as long as it solves my problem.
If I understand your question correctly the following might help. (I'm assuming no header row here)
In column G put the numbers 1 to 320, e.g. 1,2,3,4,5,6,...320 - so this takes up 320 rows.
In cell H1 put the following:
=VLOOKUP($G1,A:A,1,0)
Drag the above formulae across 6 columns - so H1 to M1 and then select the 6 cells (H1:M1) and drag them down to row 320.
In the missing numbers cells you will get a "#N/A" display so you could replace the above vlookup and use an if condition if you want. Something like:
=IF(ISERROR(VLOOKUP($G1,A:A,1,0)),"",VLOOKUP($G1,A:A,1,0))
Hope this helps.