Identify duplicate values in column groupings and then add a text label to the last group - excel

The first group contains companies identified as weekly. This includes only Company A, B, and C.
The second group contains companies identified as monthly. This includes only Company D, E, F.
The third group is a long list of companies that need to be defined by the parameters of column a in groups 1 and 2. This list will include Company A to Company J.
So, if a company from Group 1 appears in Group 3, I'd like the 'weekly' status to appear in column A for Group 3. For ex: Cell B2 contains Company A, and since it then appears in Group 3, Cell B14, I'd like the text from cell A2 to duplicate down to cell A14.
http://imgur.com/HE45TUV

As formula version, maybe in A14 and copied down:
=IFERROR(INDEX(A$1:A$10,MATCH(B14,B$1:B$10,0)),"")

Related

EXCEL - Find if value exists in column B in the range of a value in column A

I have a list of companies with certain products. Now I want to find out if one company has a certain product or not. Example, I want to find out which company had Product C and return a one on all cells:
Column 1
Company A
Company A
Company A
Company A
Company B
Company B
Column 2
Product A
Product B
Product C
Product A
Product B
Column 3 (Result):
1
1
1
0
0
This solution will require 2 additional columns. I'm assuming your first row is headers, and the range is from A1:B6. Data starts on Row 2. I'll give a few options on how to execute this though. Where I put "Product C" can also reference a cell. Whenever I'm using binary like this it's usually to filter datasets, so there might be a better alternative to what you want vs. what's below.
In Column C, =if(B2="Product C",1,0) or you can use =--(B2="Product C")
Sort by Column C in Descending Order, =vlookup(A2,$A$2:$A$6,1,0) copy and paste as values, but if you keep the formula and resort it will mess up.
If Product C would only appear once for any given company you can us Sumifs too. =Sumifs($C$2:$C$6,$A$2:A$6$,A2)
If you have 365, you can also use Maxifs($C$2:$C$6,$A$2:A$6$,A2), which won't care how you sort the dataset.

Excel: Find duplicates in one column, then remove rows based on value in other column

I've been able to find a number of articles that seem to orbit my particular puzzle, but I'm having difficulty carving out the specific solution for it. Using the below image for reference:
ID Name Company Name
5 Dennis E Lantz Boggio Architects, Pc
6 Director Lantz Boggio Architects, Pc
7 Glenn D Lantz Boggio Architects, Pc
8 Director Ge Johnson Construction
9 Evan Da GH Phipps Construction Companies
10 Paul Fog GH Phipps Construction Companies
11 Todd W GH Phipps Construction Companies
I have a mailing list that is organized so each unique contact is placed on an individual row. The list contains columns for Name (column A in my sheet) and Company Name (column B).
If the Name cell was originally empty, a default 'generic' title is entered (e.g. 'Director', as per rows 6 and 8 in the image).
In some cases, there are multiple contacts at the same company (e.g. rows 5-7, 9-11). Occasionally, one of those contacts has a 'generic' name (e.g. row 6).
What I'd like to do:
Search for duplicates in Column B
Then delete the row based on the value in Column A (with me defining the specific values to be sought for)
So in the example image, only row 6 would be deleted because Column B contains a duplicate address, and Column A contains the value 'Director'.
Thank you!
Maybe, in C5 and copied down to suit:
=AND(COUNTIF(B:B,B5)>1,A5=C$1)
with Director in C1.
Then filter ColumnC to select TRUE and delete.
COUNTIF(B:B,B5) searches for the content of B5 throughout ColumnB (the B:B) and returns the count of the instances. B5 is within ColumnB so function will always find at least 1, for duplicates more than one, so >1 should detect that the row in question (5 for example) is not the only instance.
However, similar entries will not be counted - for example those that end in a trailing space, when what is in B5 does not.

Splitting addresses into columns in Excel

I need help splitting addresses into columns in Excel.
Addresses in COLUMN A are written like:
601 W Houston St Abbott, TX 76621 United States
13498 US 301 South Riverview, FL 33578 United States
COLUMN B is actually a helper column. It contains only the city names from COLUMN A. My idea was to somehow match COLUMN B with COLUMN A and then all matches move to another column. That would separate City from the Address.State, Zip and Country I can use "split text to columns" since "comma" is delimiter. But I need help splitting address and the city.
There is a "comma" right after the city name, but some cities has more than one word in city name.
What I need to do is split the addresses like it's highlighted in green in the image below.
What is the best way to do that in Excel? What would be the formula for that?
We can use a quirk of LOOKUP to get this working.
=LOOKUP(1E+99,FIND(B$2:B$100,A2),B$2:B$100) in D2 will return the city based on searching for matches in column B. Note that this will need the full range of column B specified to be filled.
Then we can put =LEFT(A2,FIND(D2,A2)-2) in C2 to get the first part of the address.
The rest is easy if we can assume that the state, Zip and country are of constant length (if you've got any addressses outside the US then you'll need to alter this):
=LEFT(RIGHT(A2,22),3) in E2
=LEFT(RIGHT(A2,19),5) in F2
=RIGHT(A2,13) in G2
Since you already have City in Col B, just replace the city in A
D2 =SUBSTITUTE(A2,C2,"")
Column C Paste special values in Col C
Split Column C using comma.
Then split the Column D using "space". Assuming you have all records in US, you can add the country to all rows if required.
EDIT
I missed that the city name in the row does not correspond to the address. To match the city from the Master, you can use this array formula:
C2 =INDEX(B:B,MATCH(1,MATCH(""&$B:$B&"",A2,0),0))
Array formula must be confirmed with Ctrl-Shift-Enter.
However, this will find the first match. If you have cities Foster & Foster City in your master, Foster City wlll never be matched. So, sort the cities in descending order of length.
Once you have the City name matched you can follow the steps I gave earlier. Note that I have adjusted the formula to take into account the city name that has been matched by this new formula.
So, it is possible to get it done with the formula. It may not be the best way, but I got what I needed.
I've added a new sheet and named it "cities"
I moved the city list from sheet 1 to COL A in sheet "cities"
In sheet 1, B1 = =INDEX(cities!$A$1:$A$10000;LOOKUP(99^99;MATCH(RIGHT(TRIM(LEFT(SUBSTITUTE(A2;",";REPT(" ";255));255));ROW($A$1:$A$100));cities!$A$1:$A$10000;0)))
Then I've simply use SUBSTITUTE to remove city names from column A in Sheet 1: C1==SUBSTITUTE(A1, B1, "")
And that's it!

Finding companies appearing with different IDs in MS Excel

I have 2 columns in my data:
A - each company's unique ID.
B - the company name that corresponds to the respective ID.
This type of data extends to 13,000 rows. For instance:
Col A Col B
12 Google Inc
12 The Google
14 Google
18 Amazon
18 Amazon
21 Amazon INC
18 Amazon
...
As you can see from the example above, the issue is that sometimes the company has a different ID appearing. Furthermore, although in all 3 cases, the company is still the same, the fact that they've been worded differently makes it hard to do an exact match.
My goal in this exercise is two-fold:
Find which companies have different IDs showing.
Identify the row at which this happens.
It would be cumbersome to go through all 13,000 rows. What Excel formulas would do the trick?
You could use pivot tables to count how many duplicates each name has.
I would also:
Order the list by column B.
Add a formula in column c that compares the formula row with the previous row.
For example consider a formula in row 5:
=IF(B4=B5,"Identical","Different")
You could build in more intelligence for example compare the first word in the name in row 5 to see if it is in the row 4 name. eg
=IF( iserror( find( LEFT(B5,FIND(" ",B5,1)-1) ,B4,1) )
,""
,"Similar")
You could combine the above tow into a single function, or may use both in different columns (which is easier)
PART 2:
The data must be ordered by column B!
So using the above logic to compare the IDs you should add another column (column F) with this formula
= find( LEFT(B5,FIND(" ",B5,1)-1) ,B4,1)
Then add another column (column G)
=IF(B4=B5
, B5
, IF( iserror(F5) )
,""
, F5 )
)
This results in a value in column G which is either the identical company name or the first word of a company that has a matching name.
You can then add another column (column H) which compares the id's of rows with the same IDs
=IF(F4=F5
, IF(A4<>A5, "Different IDS, "Ok IDs")
, "First row in company group"
)

Identify matching numbers and then imput a value from a different column

I have two sheets, Sheet1 and Sheet2. Sheet1 has a list of company names in column A, Revenue in column B and a unique number identifier in column D (also seen as "unique #forAAA in Sheet2). In Sheet2, I pulled a list from Hoovers, and the format comes up something like below (so this format should not be changed).
Column A B C D
Company Name Place Type of Comp Revenue
1 AAA US HQ 10.0 M
2 unique #forAAA
3 BBB India Branch 5.0 M
4 unique #forBBB
What I'd like to do is match the unique number for each company between Sheet1 and Sheet2 and then put the revenue # from Sheet2 into column B of Sheet1 which corresponds to the correct #. I'm pretty lost here, so any help or ideas would be great. Thanks for your help!
Because the unique identifier is on a different row than the result to be returned, you can use a variation using INDEX and MATCH:
=INDEX(Sheet2!D:D, MATCH(D2, Sheet2!A:A, 0)-1)
INDEX will return the value within range Sheet2!D:D on row MATCH(D2, Sheet2!A:A, 0)-1.
MATCH(D2, Sheet2!A:A, 0) will give you the row number where the unique ID is found, then -1 to get the row number of the revenue amount.
EDIT: As per comment, to remove the M, you can use this:
=TRIM(SUBSTITUTE(INDEX(Sheet2!D:D, MATCH(D2, Sheet2!A:A, 0)-1),"M",""))
I would put the unique value in a column inserted before A (would be the new column A) instead of putting it below each row. Then, in the other sheet I'd put the VLOOKUP like this:
=VLOOKUP(D2,Sheet2!A:E,5,0)
That should return the value in column E (column D before the column insertion, i.e. revenue for the unique company identifier).
Note that the third argument in the vlookup function is the number of the column you want to be retrieved, so the range defined in the second argument (Sheet2!A:E) should contain that column.

Resources