Compare two tables in excel across different rows - excel

I have an excel sheet with below data:
A | B | C | D | E | F | G
----------------------------------------------------------
Apple |Orange |Mango | |1 |2 |3
Coffee |Tea |Juice | |Apple |Orange |Mango
1 |2 |3 | |Rose |Jasmine|Sun Flower
Columns ABCD and EFG are two different tables. I want to compare A to E, B to F and C to G but the problem is they will not be in the same order and there will be instances where it will not match as well.
I want to populate column D with "Exists" or "Not Exists" as part of table ABCD and say the same combination exists in EFG table. For example, for row number 1 and 3, it should say exists as these values exist in the second table in same order. All 3 columns need to match.
I tried creating a VLOOKUP using multiple references for the same but could not get it to work as its my first time. Any help is appreciated.
Thanks in advance

Use COUNTIFS and check if the result is >0.
=IF(COUNTIFS(E:E,A1,F:F,B1,G:G,C1)>0,"Exists","Not Exists")

Related

How can I use INDEX and MATCH to find a cell using two inputs and mulptiple hits?

I have a table with data. Using two inputs I want to find the first or second match and return the content of a corresponding column
Using INDEX and MATCH I'm able to find the first occurrence of matching both inputs (colour and size).
Table1
+--------+------+---------+
| colour | size | price |
|--------+------+---------+
|red | 2 | $3.00 |1
|red | 3 | $2.00 |2
|blue | 3 | $3.00 |3
|green | 5 | $4.00 |4
|blue | 4 | $6.00 |5
|red | 4 | $77.00 |6
|red | 4 | $999.00 |7
+--------+---+--+---------+
I would like to have the row number with 999 returned (row 7).
I can obtain row 6 using
=INDEX(Table1,MATCH(1, INDEX((Table1[colour] = F1) *(Table1[size] = F2), 0, 1), 0),3)
I have tried to understand examples using AGGREGATE but don't understand them.
Try this one:
On column D create a data with the item and repetition. (For me it is not clear if you are looking for the second data or just the "n" data)
So on column D add the formula: =CONCATENATE(A3,B3,COUNTIFS($A$3:$A$10,A3,$B$3:$B$10,B3)
(I am assuming that your first cell it is A3 until row 10, just custom it) In this column you will get the data:
red21
red31
blue31
green51
blue41
red41
red42
So when you are searching for the data, you can ask for the repetition you are interested in with MATCH + INDEX or VLOOKUP:
=VLOOKUP(F1&F2&F3,CHOOSE({2\1},$A$3:$A$10,$E$3:$E$10),2,0)
F3 cell will have the repetition number as you have the colour on F1 and the size on F2. If it is always the second repetition, instead of F3 place "2".
Hope it helps

Vlookup doesnt read mixture of Alphabet and Numbers eg: 1T902462K01

i have a table as below and i wanted to compare result using Vlookup.
A | B | C
-------------------------
1 | ID | Name | Lot
-------------------------
2 | 70100 | Krenn | VF849062
-------------------------
3 | 70101 | Georg | VE803354
-------------------------
4 | 70102 | Mohd | VE803354
However =VLOOKUP(C2,A1:C4,1,FALSE) will result #N/A
Any advise?
Regards,
Zaiem
Try the Index/Match suggested in the comments. It goes like this:
=index(A1:A4,match(F1,C1:C4,0))
in words: find the value of F1 in the range C1 to C4 and return the value from column A for the same row.
Your Vlookup formula references C2, which does not make sense if column C is the column where you perform the lookup.

excel address as lookup array

first of all, thank you in advance.
the problem I am facing is I have two different values I need to combine when I lookup against a different table, however I do not know which columns those two combinations will be, and they can be different per row. hopefully, the example will help
look up table
ID | Benefit | Option | Tier | Benefit | Option | Tier
123| 1 | 1 | 3 | 2 | 7 |3
456| 2 |3 |1 |1 |3 |2
current table
ID | Benefit |
123 | 1
123 | 2
456 | 1
456 | 2
the example i am giving there is only two posibility it can be in but my actual program is it could be in maybe 20 different location. the one positive i have is that it will always be under the benefit column, so what i was thinking is concat benefit & 04 and using the index match. i would like to dynamically concat based on the row my lookup is on
here is what i got so far but its not working
=INDEX(T3:X4,MATCH(N4,$S$3:$S$4,0),MATCH($O$3&O4,T2:X2&ADDRESS(ROW(INDEX($S$3:$S$4,MATCH(N4,$S$3:$S$4,0))),20):ADDRESS(ROW(INDEX($S$3:$S$4,MATCH(N4,$S$3:$S$4,0))),24),0))
where
ADDRESS(ROW(INDEX($S$3:$S$4,MATCH(N4,$S$3:$S$4,0))),20) does return T3
and ADDRESS(ROW(INDEX($S$3:$S$4,MATCH(N4,$S$3:$S$4,0))),24) returns x3
so i was hoping it would combine benefit&1 and it would see its a match on t 3
I guess you are trying to find a formula to put in P4 to P7 ?
=INDEX($S$2:$X$4,MATCH(N4,$S$2:$S$4,0),SUMPRODUCT(($S$2:$X$2="wtwben")*(OFFSET($S$2:$X$2,MATCH(N4,$S$3:$S$4,0),0)=O4)*(COLUMN($S$2:$X$2)-COLUMN($S$2)+1))+1)
If the values to return are always numeric and there is only one match for each ID/Benefit combination (as it appears in your sample) then you can get the Option value with this formula in P4 copied down
=SUMPRODUCT((S$3:S$4=N4)*(T$2:W$2="Benefit")*(T$3:W$4=O4),U$3:X$4)
[assumes the headers are per the first table shown in your question, i.e. where T2 value is "Benefit"]
Notice how the ranges change
....or to return text values.....or if the ID/Benefit combination repeats this will give you the "first" match, where "first" means by row.
=INDIRECT(TEXT(AGGREGATE(15,6,(ROW(U$3:X$4)*1000+COLUMN(U$3:X$4))/(S$3:S$4=N4)/(T$2:W$2="Benefit")/(T$3:W$4=O4),1),"R0C000"),FALSE)

Check if cells match in two columns and, if they do, copy a related value

Given a column A of 100 names and another B of numbers, where column C contains a subset of those numbers how might I populate column D with the matching name? A match is where the names in A and D are next to the same number. For example, A, B and C are inputs and D the desired output:
____A______B_______C_______D____
1 |Larry | 11111 | 22222 | Bob |
2 |Bob | 22222 | 44444 | Steve |
3 |Mike | 33333 | 55555 | Jim |
4 |Steve | 44444 | | |
5 |Jim | 55555 | | |
Please try in D1 and copied down to suit:
=INDEX(A:A,MATCH(C1,B:B,0))
Not quite sure if this is what you are looking for, but a Vlookup function should help you greatly. I used a helper column to link C1 = A1, C2=A2 and so on. You can hide this column if you need to. You can then use the formula shown below in cell E1 and drag it down. As you put numbers in column D, the name will automatically fill in column E with the matching code.

Display all matching values in one comma separated cell

I have two columns of data in an Excel 2010 spreadsheet. In Column A is a category, and in Column B is a value. There will be multiple values in Column B for each unique category in Column A.
What I want to achieve in a separate sheet is to display all of the values for each each unique category in one comma (or semi-colon etc) separated cell.
For example, if my first sheet looks like this:
----------------------
| Category | Value |
----------------------
| Cat1 | Val A |
| Cat1 | Val B |
| Cat1 | Val C |
| Cat2 | Val D |
| Cat3 | Val E |
| Cat3 | Val F |
| Cat3 | Val G |
| Cat3 | Val H |
----------------------
I'd want to display the following in another sheet:
---------------------------------------
| Category | Value |
---------------------------------------
| Cat1 | Val A,Val B,Val C |
| Cat2 | Val D |
| Cat3 | Val E,Val F,Val G, Val H |
---------------------------------------
Can this be achieved with a formula? Vlookup will only find the first matching value, of course. I've Googled it, but the individual search terms involved in the query are so generic I'm getting swamped with inappropriate results.
Please try (in a copy on another sheet):
Insert a column on the left with =IF(B2<>B3,"","x") in A2 (assuming Category is in B1). In D2 put =IF(B1=B2,D1&", "&C2,C2) and copy both formulae down to suit. Copy and Paste Special Values over the top. Filter on ColumnA for x and delete selected rows. Unfilter and delete ColumnA.

Resources