Match value in column C to data in column A and return all data of column B - excel

I have an Excel file with (for example) 4 columns and I want to search column A for a value mentioned in column C and show in column D all the results that were found in column B separated by a ; and a space.
I got this partly working with the following formula:
=IF(C3<>"";TEXTJOIN("; ";TRUE;IF(($A$2:$A$6=$C2);$B$2:$B$6;""));"")
The thing is, this formula doesn't show any results when the search criteria is not 100% matching.
The following doesn't work:
=IF(C2<>"";TEXTJOIN("; ";TRUE;IF(($A$2:$A$6=("*"&$C2));$B$2:$B$6;""));"")

Perhaps:
=IF(C2<>"";TEXTJOIN("; ";TRUE;IF(ISNUMBER(SEARCH($C2;$A$2:$A$6));$B$2:$B$6;""));"")

Related

Matching columns with similar strings

I am trying to match the columns based off the first 8 characters and the last 2 characters so i would then be able to run a vlookup on it:
The issue is the middle of the cell is always different in the first column is all 10 in the middle, the second 25 and so on. I tried collecting the first 8 and last two characters by a left and right and then tried an approx vlookup but it wasn't working for me just showing an error for me.
My attempt
=LEFT(C2,FIND("/",C2)+3) & " " & RIGHT(C2,FIND("/",C2)-3)
Gives me this:
20.5/010 ES
Trying to run off Col B in the photo
Desired result:
Here is the Error I am receiving:
Assuming you have three different type of data e.g.; 20.5/010/010/, 20.5/010/025/ & 20.5/010/022/ and you will delete your column B (which is empty in your input data) you will have column A, B and C populated (Makes sense?)
Your output data clearly shows you have a list of 010 values in column 10 and you want to know if there is a match for the other two values with the same country code. But I'll make that column D in this example. So:
Have column D populated like your output column 10.
Add this formula to column E and drag down:
=IFERROR(INDEX(B:B;MATCH("20.5/010/025/"&RIGHT(D1;2);B:B;0);1);"")
Add this formula to column F and drag down:
=IFERROR(INDEX(C:C;MATCH("20.5/010/022/"&RIGHT(D1;2);C:C;0);1);"")
My output:

Excel: Finding next equal match in column

I've googled for a solution to my problem for days and I just can't seem to get my head around how to do this.
I have 28 chickens and I track the eggs each one lays each month. My Excel sheet looks like this:
Current Egg-cel sheet
Column C is populated by the formula:
=LARGE($A$2:$A$29,$B1)
I'm using column B to increment the LARGE function
I want column D to populate with which chicken number laid the quantity in column C.
Obviously INDEX MATCH or VLOOKUP returns the first match for all equal values. How do I find the the next match? i.e.
Egg-cell sheet 2
I've seen similar questions and solutions but I for the life of me can not get it to work.
Use this formula in D2:
=INDEX(B:B,AGGREGATE(15,6,ROW($A$2:$A$29)/($A$2:$A$29=C2),COUNTIF($C$2:C2,C2)))
And drag down
If you're happy to add a few helper columns, this is a simple way to go:
The formula in column C creates a unique number by bringing together the eggs laid and the chicken number
=--(A2&"."&B2)
Column D is just your LARGE formula,
=LARGE($C$2:$C$4,B2)
Column E just gets the integer part of column D
=INT(D2)
And finally Column F gets the decimal part (chicken number) from column D
=--REPLACE(MOD(D2,1),1,2,"")

In Excel I have two columns that equal a third column but they don't equal each other. How do I get them to equal each other?

In Excel I have two columns that equal a third column. How do I get the first two to correspond to each other? Listed below is a small example. Sorry I didn't know to properly paste the Excel into this post. As you can see I have Columns A-E with the titles UPC, Barcode, RMSID, UPC and Barcode. Columns A and D are the same value of a UPC. Both B and C correspond to the UPC column or A and D. I want B and C to correspond to each other since they both share the value of A or D. So if C and D correspond to each other then B does also and I want this to show in Column E. How do I write this in Excel?
A B C D E
UPC Barcode RMSID UPC Barcode
834135001034 102432 883 892773000857 105422
892773000864 105423 884 818780010016 106487
892773000604 105421 888 892773000864 105423
892773000857 105422 900 892773000604 105421
818780010016 106487 910 834135001034 102432
ok, this looks like a straight forward Vlookup or index/ match. In E2 place the following formula:
=Vlookup(D2,$A$2:$C$6,2,0)
D2 is what you are looking up in the first column of A2:C6 where C6 is the bottom right corner of your data. the 2 tells the formula to return the value in the second column. the 0 or false tell the formula to find an exact match for what you are looking for.
you could also do this with an INDEX/MATCH combination. It tends to be preferred as vlookup only looks up information in the left most column and can only return information to the right. INDEX/MATCH does not have to line up vertically and the columns (or rows if you are doing horizontal lookups) can be in any order. I would use the following:
=INDEX($B$2:$B$6,Match(D2,$A$2:$A$6))
Match will tell you what postion from the top of the A2:A6 column the value in D2 was found. Index will then use that value to return the value in the same position from the top in column B2:B6.
When something is not found its going to spit out and error. You can deal with that error using the IFERROR function and either have it return some text to let you know, or return an empty cell with "". Here is one example:
`=IFERROR(VLOOKUP(D2,$A$2:$C$6,2,0),"Not Found")

How to return a value to the left of a table array with VLOOKUP?

I need help searching Column E for value=1 and return the value of column A for the same row. VLOOKUP isn't working because there are many columns being searched and there are several 1's in the lookup, and I couldn't seem to search just 1 column using VLOOKUP. Here's how my spreadsheet looks...
A B C D E
1 Name Weight WeightRank Height HeightRank
2 Mike 170 3 6.3 2
3 Richard 200 1 6.0 3
4 Charles 185 2 7.0 1
So I want to search column E for value=1 and return the corresponding value in column A, which in this example would search "HeightRank" for "value=1" and return "Charles"
I tried using =VLOOKUP(1,E:E,1) but that returns an error.
I tried using =VLOOKUP(1,A1:E3,1) but that returns an error.
INDEX(A:A,MATCH(1,E:E,0))
VLOOKUP doesn't work here -- it always searches in the first column of your table and returns a value of a column a given number of columns to the right.
The INDEX/MATCH combination is more flexible, letting you just choose the two columns you want. It's also easier to read (you don't have to count columns to see what it does) and it doesn't break if you insert or delete columns in between the ones you're using, which VLOOKUP does. If you use the trace-formula features, VLOOKUP also falsely implies that all the columns in between are precedents of your resulting formula. (Can you tell that I don't much like VLOOKUP? I just always use INDEX/MATCH and my life is easier for it.)
The OFFSET solution works but it's volatile, so you'll really bog down your worksheet if many cells depend on the result of your formula.
MATCH(x,E2:E4,0) returns the relative position of x in the range E2:E4. For example, MATCH(1,E2:E4,0) returns 3, because 1 is the value of the third cell in the range E2:E4.
OFFSET(A2,r,c) returns the cell r rows and c columns away from A2.
Thus you can say =OFFSET(A2,MATCH(1,E2:E4,0)-1,0) to return the value from column A corresponding to the cell in column E that contains 1.

Problems with implementing a two criteria vlookup substitute (sumproduct or index)

I have data on two tables, DATA and SpreadCodes. I need to write a formula that functions like a two-criteria vlookup. My tables look like this:
DATA table:
Col B ... Col I
01142 589
57834 007
Where Column S is where I'm trying to put the formula and where entries in Columns B & I are numbers stored as text.
SpreadCodes table:
Col A ... Col E ... Col G ... Col J
57834 007 15.50 15.50
45785 35893 10.00 10.00
Where entries in Columns A,E & G are numbers stored as text and where entries in Column J are stored as numbers.
I am trying to search the SpreadCodes table for the row where entries in DATA column B equal SpreadCodes Column A and where Data Column I equal SpreadCodes column E. Once a match is found, I need it to return the value in SpreadCodes column G OR Column J (They are the same, except G is stored as text, J is stored as number, so whichever makes this work).
I have tried several approaches to try to make this work. Nothing I tried below would return anything except an #NA value
I first tried creating a "helper" column where I concatenated the columns in both tables then just compared those values.
I then tried using two different index/match formulas (where one has concatenation included) :
=INDEX(SpreadCodes!G2:G202,MATCH(1,(SpreadCodes!A2:A202=B2)*(SpreadCodes!E2:E202=I2),0),7)
=INDEX(SpreadCodes!A1:K202,MATCH(Sheet2!B2&Sheet2!I2,SpreadCodes!A:A&SpreadCodes!E:E,0),7)
When that didn't work, I tried a sumproduct formula (being careful to specify SpreadCodes column J, since that one was a numerical value):
=SUMPRODUCT((SpreadCodes!A2:A202=Sheet2!C2)*(SpreadCodes!E2:E202=Sheet2!I2)*(SpreadCodes!J2:J202))
Since these codes often have leading zeros, I keep the columns in text so they don't get cut off, but even still, I'm not sure why these formulas aren't working. I've seen these work for other data. Any thoughts/ideas would be appreciated.
The sumproduct() works for me.
=SUMPRODUCT((SpreadCodes!A1:A100=Data!B1)*(SpreadCodes!E1:E100=Data!I1)*(SpreadCodes!J1:J100))
As per your data, This is how my data sheet looks like

Resources