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

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.

Related

How to match up 2 columns with 2 other columns

In column A I have product id's and column B has the number of times the product in column A was quoted.
In column C I have the same product id's (but in different order) and column D has the number of times the product in column C was actually sold.
I want to match them up to add a final column in order to divide sales/quoted in order to get a value of efficiency in sales.
I believe it's an index/match/match but I'm not sure how to set it up.
Please help
Try
=B3/vlookup(A3,C:D,2,false)
In words: take the value in B3 and divide it by the value from column D where column C has the same text as A3.

count unique values by category using excel formula

I have a database table with a set of category names in column A. think of it as category A, B, C, D, etc. then in column b I have numbers for each category. for a specific category, say category A, the related numbers are not unique and may occur in different frequencies.
now I have another table, a summary one and I want a formula to count unique numbers for each category from the database table and return it in front of the category name.
I use excel 2010
for some reasons I do not want to use pivot table or macros
data is as below
A 10
A 10
A 20
A 15
B 25
B 25
B 25
B 30
B empty(blank)
the desired results should be as this
A 3
B 2
thanks for help
So an example of sumif() and countif().
But I am not sure what you really want as there are 4 categories of A, and 4 of B - unless some numbers must be ignored.
However, see:
Note, if the columns A & B only have the relevant information you can define the range as A:A, but if the range has to be limited then you need to use A1:A17.
Edit try:
The best way of doing these is to use Frequency:
=SUM(--(FREQUENCY(IF(A$2:A$20=D2,B$2:B$20),B$2:B$20)>0))
entered as an array formula using CtrlShiftEnter
Plz search on 'Count unique with a condition' for more information.

Excel - how to look in a dynamically changing range of multiple rows and columns and retrieve data

I have 2 excel files. 1 is a workfile in which I work, the other is the output of a database. See pic 1 for my database output (simplified).
What we see here:
The purchase order numer in column A
The row in the database in column B
The status of the row in the database in column C
The classification in column D, where W means a product we want to measure and P meaning delivery costs, administration costs etc (we don't want to measure this)
The number of items ordered and the number of items delivered in column E
The company name and product info in column F
Now, what I want, is something like this:
I want this table to be filled automatically based on the database output. It works for column B, but I'm stuck on column C, D and E.
What I want from you!
I need help with column C, D and E.
Number of rows: it needs to calculate the rows only with W in column D. So for item 4410027708 it has to be 2 (only 2 rows with W) and for item 4410027709 it should be 1.
Items ordered: it needs to add-up all the values that are directly to the right of the W in column D. So, for 4410027708, it needs to add up 3 and 5. It must ignore all the rows with P!
Items to be delivered: You may already guess this, but it needs to add up all the values in column E that are on the same row as column C with To be delivered, but only for the W rows (not the P versions). So, for item 4410027708 this should be
I suggest easy if ColumnA can be filled down first (including for the last entry) then assuming the database output sheet is called Sheet1, in:
C2: =COUNTIFS(Sheet1!A:A,A2,Sheet1!D:D,"W")
D2: =SUMIFS(Sheet1!E:E,Sheet1!A:A,A2,Sheet1!D:D,"W")
E2: =SUMIFS(Sheet1!E:E,Sheet1!A:A,A2,Sheet1!C:C,"To be delivered")
copied down to suit.

Excel look up value in array, return next value

I would like to look up a value in a range and return the value in the next row, but can't quite figure out how to do this. I especially would like to do this with formulas rather than VBA, and preferably with built-in formulas than custom (VBA) formulas, due to macro security issues.
I'm using Excel 2010. My workbook has two worksheets, "assessment" and "lookup". In lookup, I have lookup tables.
"lookup" looks something like:
Column A Column B Column C
1 Sales Engineering Manufacturing
2 Alice Bobbie Charlie
3 Dawn Edgar Frank
4 George Holly Isabel
In "assessment," I have some some drop downs from which users select one name from each column in "lookup." Based on some other criteria, I then rank these and create a new, sorted list (using INDEX() and MATCH()) that produce the selected name and corresponding column name a new sort order
Column A Column B
10 Engineering Edgar
11 Sales Alice
What I'd like is to return the name from the next row.
Column C
10 Holly
11 Dawn
But I'm having real trouble figuring out how to get there.
Assuming lookups is located at B2:D5 (change as required) and the result data is at F2:H3 (change as required) enter this formula in cell H2 then copy down.
=INDEX(
INDEX($B$2:$D$5,0,MATCH($F2,$B$2:$D$2,0)),
1+MATCH($G2,
INDEX($B$2:$D$5,0,MATCH($F2,$B$2:$D$2,0)),0))

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"
)

Resources