Matching columns with similar strings - excel

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:

Related

extract ranges from column values

I've column of values 1-10 missing 4 and 7 can I extract 1-3,5-6,7-10.
Currently I'm using this formula =IF(A3=A2+1,C2,C2+1) which gives me helper column sort of help
but my list is long If I could extract ranges that would be helpful.
There are no duplicates
I'm not sure if I understand exactly what you mean, but this is what I have done until now: I have copied the same columns A and B, and I have added following columns:
Column C : =COUNTIF(B$2:B$16,B2)
Column D : =IF(AND(C2=C3,C3<>C4),"End",IF(AND(C2<>C3,C3=C4),"Begin"))
The result looks as follows:
As you can see:
The number 1 from column B ends at row 6, and D6 indeed indicates "End".
The number 2 from B starts at row 7 (D7="Begin") and ends at row 8 (D8="End").
The numbers 3 and 4 are not correctly handled but:
As far as 5 is concerned: it starts at row 11 (D11="Begin") and ends at row 15 (D15="End").
There still is some finetuning to do but I guess you see how the ranges start being unfold.

Get Spill-result to reference correct row #

As a result of this closed topic I started wondering myself the following:
Let's say we have data like this:
A
1
a
2
b
3
c
4
a
5
b
6
c
7
g
8
h
9
i
I want to divide the list into 3 (I used TEXTJOIN) and check which of the 3 of these is unique.
I used a combination of MATCH and COUNTIF (and SEQUENCE) for this.
Question:
I managed to get that correct, but wanted to get the 3 textjoin-results all at once as a spill range.
In the picture below you can see my results of attempts, but I couldn't get the TEXTJOIN to reference the correct column in it's spill-result. What is missing, or what am I doing wrong?
Not sure what you want for output.
If all you want is to determine which is/are unique entries, just use the UNIQUE function. Note the exactly_once argument.
For example:
C1: =OR(B1=UNIQUE($B$1:$B$3,,TRUE))
and fill down, but the formula will fill down automatically.
Edit:
I don't know how to get the TEXTJOIN function to spill down in groups of three like you want. However, to be able to enter the formula just once, and have the results appear in column B, and have that adjust as you add/remove entries from column A, you can use a Table structure.
In that case, row 1 would be the column headers, and the formula in B2 would be:
=IFERROR(TEXTJOIN(",",TRUE,INDEX([Column1],SEQUENCE(3)+(ROW()-ROW(Table2[#Headers]))*3-3)),"")`
No need to fill down.
Edit2:
To create a list of unique (listed only once) values from Column B in Column C, you can use the UNIQUE function. However, due to limitations on SPILL functions within a Table, this column cannot be part of the table.
In the example below, where Column C is NOT part of the table:
B2: =IFERROR(TEXTJOIN(",",TRUE,INDEX([Column1],SEQUENCE(3)+(ROW()-ROW(Table2[#Headers]))*3-3)),"")
C2: =UNIQUE(Table2[Column2],,TRUE)
Edit3:
If you were OK with omitting columnB, and reporting the unique triplets in separate cells instead of concatenated, you could do that with the UNIQUE function:
or, without a table,
=UNIQUE(INDEX($A:$A,SEQUENCE(COUNTA($A:$A)/3,3,2)),,TRUE)
Note that the start argument in the SEQUENCE function represents the first line of data in column A, (2 in this example)

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

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

Excel line up data

I'm a total Excel nub and can't find the answer I'm looking for. Must be easy peasy, but since I'm not into Excel I also don't know what to look for. Sorry if I'm having my question wrong.
I have output in Excel like this:
A 1
A 2
A 3
A 4
B 1
B 2
B 3
B 4
B 5
B 6
and I want it like this:
A 1 2 3 4
B 1 2 3 4 5 6
this question is quite complex in a way.
let me explain it more in detail:
as you see above, we have two columns A and B, you have text strings in column A , these text strings could be repeated. As you see in the example, there are 4 As, 5 Bs, 3 Cs 1 D and 3 Es. In column B each one of these strings have different corresponding values. For example, text strings B in column A has five corresponding values in column B, namely 11, 12, 13, 14, 15, and 16.
Now we want a list of UNIQUE values from column A, and lets say, we put this list in column C and then for each of these unique values in column C we want to list their corresponding cells in column B and put them HORIZONTALLY in front of each of these unique text strings in column C.
For this you need two kinds of formulas:
Formula 1 to calculate the list of the unique values in column A :
this goes in C2:(leave C1 empty)
=IFERROR(INDEX($A$1:$A$999;MATCH(0;FREQUENCY(IF(EXACT($A$1:$A$999;TRANSPOSE($C$1:C1));MATCH(ROW($A$1:$A$999);ROW($A$1:$A$999)); ""); MATCH(ROW($A$1:$A$999);ROW($A$1:$A$999))); 0)); "")
this is an array formula, so press ctrl+shift+enter to calculate the formula, and drag and fill down as many as you want in column C.
*Formula 2 to find and list horizontally the values from column B *
=IFERROR(INDEX($B$1:$B$999;SMALL(IF($C2=$A$1:$A$999;ROW($A$1:$A$999)-ROW($A$1)+1);COLUMN(A$1)));"")
this is an array formula, so press ctrl+shift+enter to calculate the formula, put this in D2 and drag and fill down until the last cell of column C. then select D2 to D6 and drag and fill horizontally. You should get all of the corresponding cells in front of each unique item.
P.S. adjust the formulas to meet your regional settings by replacing ; with , I suppose.
Finally here is the link to an example sheet downloadable from here .
This is very generic but hopefully will help.
Highlight the cells that you want to transpose to.
Type the equation..."=TRANSPOSE(B1:B4)" (edit as necessary).
While the cells are still highlighted, press "ctrl+shift+enter". (brackets should appear around the equation)
Finish editing the cells.
Celebrate

Compare two Excel columns, output cells in A that do not appear in B

I am trying to compare two columns in excel, A and B. Column A contains a complete list of customer numbers. Column B contains an incomplete list of the same customer numbers. So if a customer number is in A, but not in B then output that number to column C.
I'd use the MATCH function in combination with ISNA.
If I have the following table
A B C
1 4
2 3
3 1
4 7
5 2 5
6 6
7
I put in column 'A' the full customer list, and in column B is a random ordered partial list. I then put the function in C1 (and the rest of column C):
=IF(ISNA(MATCH(A1,B:B,0)),A1, "")
Now I see the values '5' and '6' only in column C, because those are the only two numbers that don't appear in column B.
In Cel C1 =IF(ISERROR(VLOOKUP(A1,$B$1:$B$10,1,FALSE)),A1,"")
Adjust for row counts and fill down against column A.
I think you're looking for something like this:
=IF(ISERROR(MATCH(A1,B1,0)),A1,"")
Propegate that formula along your new column and it'll reprint the populated Column A when Column B is a no match.
Reference URL: http://support.microsoft.com/kb/213367
(I believe I read the original question wrong, and am going on the assumption that column A and B are already sorted where the values will line up.)

Resources