I have two big columns that I'm comparing in Excel. I want to print out the values that column A has from Column B.
This is what I've tried: =ISNA(MATCH(A3,$A$:$D$28309,0))
Column A Column B Column C
A B B
B C C
C E
D E
A E
If one has the dynamic array formula FILTER:
=FILTER(A1:A5,ISNUMBER(MATCH(A1:A5,B:B,0)))
If not then INDEX(AGGREGATE()). Put this in the first cell and copy down:
=IFERROR(INDEX(A:A,AGGREGATE(15,7,ROW(A1:A5)/ISNUMBER(MATCH(A1:A5,B:B,0)),ROW(ZZ1))),"")
Assuming your original range is A1:B6 As you drag this formula down column C it will list all of the common values in the order of the first column then produce a #NUM! error when it runs out of matches. You can use an IFERROR formula to change the result to something else in those cases.
The size of the column don't need to match either.
=INDEX($A$2:$A$6, SMALL(IF(COUNTIF($B$2:$B$6, $A$2:$A$6), MATCH(ROW($A$2:$A$6),ROW($A$2:$A$6)), ""), ROWS($A$1:A1)))
Make sure to hit CTRL + Shift + Enter as this is an array formula.
Related
I have a sheet with 4 columns, see screenshot_1
Column A - word
Column C - word (column A) + extra word
The rows of Column A and column C and their values (column B and D) are not lined up. As you can see in the screenshot,
I want to place C2 And D2 on line 29, C3 and D3 on line 15, etc. So column C and D are filled with the matching word of column A (if it exists).
Resulting in something like screenshot_2
Is there a formula to line up column rows based on cell value or partial value?
Screenshot 1
Screenshot 2
You can achieve this by using wildcard in Vlookup. Enter this formula =VLOOKUP("*"&A2&"*",$F$2:$G$26,2,FALSE) in column C.
Possibly the easiest solution would be to keep columns A and B untouched, and have column C automatically display "used (whatever)" if column D contains a number.
To accomplish this, type the following formula into cell C2 and drag down:
= IF(ISNUMBER(D2),"used "&A2,"")
First, separate the ranges with some empty columns; so column A & is the same, C is empty, D & E are a not connected
Create a new column in the empty C column:
=IFERROR(IF(MATCH("*"&A2&"*",F:F,0),VLOOKUP("*"&A2&"*",F:G,2,0),""),"")
See this Example
I have the following column, A
C
R
H
Z
T
I would like a formula that automatically copies the data from A to B so that the data has no empty elements and it is sorted.
Column B should then look like:
C
H
R
T
Z
After that, if I were to add an element such as F to column A, such as:
C
R
H
Z
F
T
Column A would automatically update as:
C
F
H
R
T
Z
How can this be done with formulas (non-VBA code)? I'd like it to happen automatically (meaning i don't have to keep going to filter, sort every time a new piece of data is added to column A)
Thanks
You will need to create a helper column, with this array formula:
=SUMPRODUCT(IFERROR(CODE(UPPER(MID(A1,ROW(INDIRECT("1:"& MAX(LEN($A$1:$A$9)))),1))),10)*100^(MAX(LEN($A$1:$A$9))-ROW(INDIRECT("1:"& MAX(LEN($A$1:$A$9))))))
Being an array formula it needs to be confirmed with Ctrl-Shift-Enter instead of Enter when exiting edit mode. IF done correctly then Excel will put {} around the formula.
Then you would use this formula to sort and filter:
=IFERROR(INDEX(A:A,AGGREGATE(15,6,ROW($B$1:$B$9)/((AGGREGATE(15,6,$B$1:$B$9/($A$1:$A$9<>""),ROW(1:1))=$B$1:$B$9)*($A$1:$A$9<>"")),1)),"")
One note, this may implode with large strings.
You can use this array formula and drag it down, A1 your first Data in column A, in B1 write helper column to sort values:
=IF(COUNTIF($A$1:$A$21,"<="&A1)>0,COUNTIF($A$1:$A$21,"<="&A1),999999999)
and drag it down
In C1 write =IF(INDEX(A:A,MATCH(SMALL(IF(B:B<>0,B:B,999999999),ROW(A1)),B:B,0))=0,"",INDEX(A:A,MATCH(SMALL(IF(B:B<>0,B:B,999999999),ROW(A1)),B:B,0)))
Press Ctrl+ Shift+Enter at the same time
IF will check for non empty cells and return the corresponding row
Small will find the upper non empty cell and move with the row,in row1 Small(,1)
in row10 small(,10)
INDEX(A:A) is your initial column
IFERROR in case the cells in A are empty it will return "" empty in column B
You have to drag the formula down even if you have empty cells in A, in that case when you write in the cells the formula will autofill in column B
9999999 it will not affect the small function
Without helper column you will need to sort the Data or use it unsorted but remove blank
You can use in B1:
=IFERROR(INDEX(A:A,SMALL(IF(A:A<>"",ROW(A:A),999999999),ROW(A1))),"")
Also array formula
Press Ctrl+ Shift+Enter at the same time
and drag it down
Another idea assuming your column contains only single characters,
Formula in column B,
=IFERROR(CODE(A:A),"")
Formula in column C,
=IFERROR(CHAR(SMALL(B:B,ROW())),"")
When you enter the formula you should not be doing it cell by cell or by dragging it. Select the entire column, paste the formula in formula box and press CTRL + ENTER. This will apply the formula for all cells in that column.
enter image description here
I need to do this in excel and I do know how to do this with python etc, but it has to be done in excel either VBA or formula (best option).
Column A, contains a "W" character.
Column B, contains a "abc" cell that will be the same everywhere (The other rows won't be the same).
Column C, I am concatenating all cells in column B before column A hits a "W" value.
I want to achieve some sort of a formula in a single or multiple steps that will allow me to concatenate all B column rows until column A has a "W". The concatenation must happen in same row as "abc" in column B, but paste on column C.
Thank you in advance
If you can use column D (as an intermediate step) as well as C, set C2 to
=IF(A2="W",D2,"")
and set D2 to
=B2&IF(A3="W","",";;"&D3)
then copy column C and D down as far as necessary.
I would like to have a formula that scans through one column of data, and should this column be non-zero, it registers the contents of a cell in another column, but the same row. I would also like it to trim out the blank cells. Is this possible in Excel 2007?
for example: I have,
column A
A
B
C
G
H
column B
1
2
blank
blank
8
If the criteria is a non-zero column B, we have the following output:
column N
A
B
H
The usual way to do something like this would be to use INDEX and SMALL in an array entered formula:
=IFERROR(INDEX(A:A,SMALL(IF(B:B<>0,ROW(B:B)),ROWS($B$1:B1))),"")
Put that in the first cell in column N and after typing the formula, don't press Enter. Instead, press Ctrl+Shift+Enter
And then you can drag it down.
I have tried finding this solution on the web but have not had success for this specific problem. In Excel 2010 I have some data in column A where each value may partially contain data in column B.
EX:
Column A might contain "http://google.com/webmasters"
Column B might contain "google.com"
This should give me a match.
I want to print in Column C all values in column A that do not contain any values from column B.
EX:
Column A
http://dir.mydomain.tdl
http://myotherdomain.tdl
http://blog.otherdomain.tdl
http://www.lastdomain.tdl
Column B
mydomain.tdl
lastdomain.tdl
Column C (results required)
http://myotherdomain.tdl
http://blog.otherdomain.tdl
Any help would be greatly appreciated.
I think I have the solution using ARRAY formula. Assuming your input AND that columns A-C have titles, or simply, strings are listed starting cells A2 and B2, do the following:
C2: type the formula =IF(OR(NOT(ISERROR(SEARCH(INDIRECT("B2:B"&(COUNTA($B:$B))),$A2)))),"",$A2) but press CTRL+SHIFT+ENTER instead of usual ENTER - this will define an ARRAY formula and will result in {} brackets around it (but do NOT type them manually!).
Autofill formula in C2 until the end of list in column A, e.g. if the last value is in A100, then autofill up to C100 (how long column B does not matter here).
You may then copy & paste obtained results as values and sort out empty strings.
Here you go! The key here - we check every string in column A for having at least one match among array of strings in column B, and return empty string in case at least one match found.
For your convenience sample file is shared: https://www.dropbox.com/s/janf0xxon4z2yh5/DomainsLookup.xlsx
Maybe not the must efficient but you could simply use two arrays - one for Column A and one for Column B. Iterate through ColumnA array to see if it exists in ColumnB array (use Array.IndexOf or .contains). If it does you could remove it from the ColumnA array and output the remaining values in Column C as the remainder.