Checking to see if two rows have similar data in excel - excel

I want to compare data in two excel cells (from two columns) and write the matching values only to third column.
I have two lists of countries, column B has roughly 120 countries while column A has roughly 192 countries. I can't figure out a way to display the countries that correspond with each other (seeing if B belongs in A).
Here is an example of what I pulled off from another thread and it doesn't work for me.
excel question
Now, here is my spreadsheet.
My spreadsheet
I just want to validate and compress the countries that are listed in column B to see if they match Column A and print them in C.
Please let me know how I would do so?
Thanks,

You can use this formula in cell C1 and drag down as far as necessary.
= IF(SUMPRODUCT((B1=A$1:A$192)+0)>0,B1,"")
This formula returns the country name in the cell next to it if the country exists in the A column, and blank otherwise.

Related

How do you write an array formula based on multiple criteria in MS Excel?

So I have two columns in MS Excel, Let's call them A and B, and I'm trying to create an array formula that let's me create a list from B, based on a specific paired item on the same row in column A. I know how to write a formula to return a list of unique values from one column, but is there a way to create a unique list from one column based on values from another?
Thanks in advance. I've been using this site for years but never had a question that wasn't answered previously. You've all helped me out so much in the past.
Here's an example of what I'm trying to do.(Hopefully this makes sense)
This isn't an exact copy of what I want but it's an approximation. I'm trying to fill out the colors of the corresponding car types without any duplicates.
Here is an example of getting the unique items in column B for column A having the value "mike" using Excel 365. Pick a cell and enter:
=UNIQUE(FILTER(B1:B12,A1:A12="mike"))

Excel: Four columns with different lengths and data values, need to find matching values

I have a sheet with 4 columns of data. The first two columns show the name of a stock, followed by a PipDigit. These two values are connected and must not be seperated. The other 2 columns are another set of stock names and accompanying PipDigits. I want to do several things:
First, compare the stock names in each column and arrange it in such a way that matching stock names are aligned. The columns have different lenghts.
Second, I want another column to display which matching stocks have different PipDigit values. For example if for an Ebay stock I have a PipDigit of 2 in the first set of columns, and a PipDigit of 4 in the second set of columns, I would like to see message saying "different" or something similar. I have included a screenshot of the file.
If anything is unclear please let me know
This is the file in question
I believe from your question you are looking for the corresponding record in columns E/F for the 'Symbol' in column A.
The easiest way to get this data would to perform a VLOOKUP on the first column, looking at the data in columns 3/4.
In cell C2 you want the following formula:
=VLOOKUP(A2,E:F,2,FALSE)
This will give you the corresponding pip-digit from column F.
Now in cell D2, enter the following formula:
=IF(B2=C2,True,False)
This will give you a column telling you whether the pip digits match.
Drag these two formulas down to replicate for each row of the table on the left.

Sumif based on multiple criteria and location

I'm trying to use Excel to extract figures based on multiple criteria and their location within columns.
So for example. If I wanted to do a SUMIF to receive the figures associated with the First class. The formula would retrieve the figure in a specified row,
But If I wanted to retrieve the figure associated with England. The formula would contain multiple criteria to look for the First class then look for the country England and retrieve the figure on its row in a specified column.
These columns will grow and shrink each month. Meaning I need it to be somewhat dynamic.
I've tried to do this using SUMIF and SUMIFS with no luck.
=SUMIFS(D2:D10,A2:A10,"First",B2:B10,"England")
The challenge you have is that in columns A, B and C, the values are not repeated downwards into the now blank cells. So values do not appear next to each other in the same row.
Assuming that the example you gave is quite simple, and you could also have multiple International Products for a given Class and Country, I would go for the following solution:
Reserve two columns (E and F) for intermediate calculations. If they are currently used, move those used columns to the right, making room for an empty E and F column. You could of course also choose two other columns for this purpose. But I will assume they are E and F.
Then in E2 put this formula and copy it further down the E column as far as needed.
=IF(A2<>"", A2, OFFSET(E2,-1,0))
In F2 put this formula and copy it down as well:
=IF(B2<>"", B2, IF(A2<>"", "", OFFSET(F2,-1,0)))
This should give the following display (the header titles in E1 and F1 are cosmetic only):
Now you can do formulas on those columns in combination with the C column. For instance:
=SUMIFS(D2:D10, E2:E10,"First", F2:F10,"England", C2:C10,"")
And this would output 2. Note that if you really only want to match one row, you should specify a condition for each column (E, F and C).
The intermediate formulas in the E and F columns are quite resistant to deletion of rows, due to the use of OFFSET. If you insert rows, you should of course make sure the formulas in E and F are copied into it.
If you will ever use more than 3 columns for the source data, you'll need to also add more intermediate columns with similar formulas. Also your SUMIFS would need extra conditions then.
You could use the following SUMPRODUCT() For Class and Country:
=SUMPRODUCT(($A$2:$A$10=$F$1)*($B$3:$B$11=$G$1)*($D$3:$D$11))
Then for all three:
=SUMPRODUCT(($A$2:$A$10=$F$1)*($B$3:$B$11=$G$1)*($C$4:$C$12=H1)*($D$4:$D$12))
A picture for references.
The idea is that each column must move down one row in its reference. And the Sum column must start on the same row as the last column being referenced.

Filter information in two columns

I need a hint is solving Excel task. I have two columns with data (let's say column A contains a list of people I have met in May; column B a list of people I am planning to meet in June).
Is there a function in Excel which will compare both columns and give me a list of people whom I have met in May but who are not included in the list of planned meetings in June, and show results in column C?
No, but a combination of functions achieves the result. Please try:
=IFERROR(MATCH(A1,B:B,0),A1)
copied down to suit.
If the name is not listed in ColumnC then a number should be returned that indicates the position in ColumnA where the name is present in addition to in ColumnB.
IFERROR
MATCH
With data like:
In D1 enter:
=IF(ISERROR(MATCH(A1,B:B,0)),1,"")
and copy down and then in C1 enter:
=IFERROR(INDEX(A:A,MATCH(ROW(),D:D,0)),"")
and copy down. This results in:

Getting the average of values who share a value in a different column in Excel

I am messing around with Excel 2007 and I'm looking for a solution regarding finding the average of values who share a value in a different column.
The values in column A are all numbers running anywhere from 0 to several dozen. Column B has either Yes or No in it, one for each row. What I am looking for is being able to calculate the average of all values in column A who share the same word in column B.
Initially both will be empty, and only after the field in column A has been filled will column B be filled. The value of column A does not always mean that it always have the same value in column B, meaning that that two instances of the number 8 in A can mean that either, both or neither values in B will be Yes.
I am looking for two formulas to give me these averages: one average for all the Yes numbers and one for all the No ones, but not in VBA.
Thank you in advance!
Not sure I understand, but please try say in D1 and copied down one row:
=AVERAGEIF(B:B,C1,A:A)
where C1 is Yes and C2 is No.

Resources