The data is there, but it's out of sight because of the blank rows that are included due to the use of whole columns (A2:B
). Filter the rows where A or B cells are not empty. One way to do that is by using QUERY(), i.e.:
=QUERY({{'source data 1'!A2:B};{'source data 2'!A2:B}},
"Select Col1,Col2 Where (Col1<>'' OR Col2<>'') Order by Col1",0)
The Arrayformula can keep you from copying the formula down. For your use, you want to use vlookup to find and return the value. You will only be able to return the values for one matched domain, so I will assume this is coming from column H in your images.
The simple version places a formula in each column, starting with the USERNAME, place this in cell B2 and make sure cells B3 to the last cell in the column are empty:
=ARRAYFORMULA( IF(ISBLANK(H2:H),,VLOOKUP(H2:H,Sheet2!A2:C,3,FALSE)))
This breaks down as follows. The IF(ISBLANK(H2:H),,
takes care of empty rows, returning no value if cell H in a given row. Note that this is very different from returning "" such as IF(ISBLANK(H2:H),"",
which in Google Sheets actually returns a value of nothing. The VLOOKUP() looks in Sheet2, columns A through C for a value from column H. If one is found it returns the value from the third column. You could do a similar function in cell C2, making a couple minor changes.
If you want to get REALLY tricky, you can combine both of these and place the formlua in cell B1, making header entries and populating the columns with one formula:
=ARRAYFORMULA(IF(ROW(A1:A) = 1, {"USERNAME", "PASSWORD"}, IF(ISBLANK(H1:H),, {VLOOKUP(H1:H, Sheet2!A2:C, 3), FALSE), VLOOKUP(H1:H, Sheet2!A2:D, 4, FALSE)})))
This first checks to see if the arrayformula is working in row 1. If it is, it returns an array of the headers via {"USERNAME", "PASSWORD"}
The curly brackets define an array. The second set of curly brackets returns an array of the two VLOOKUP formulas.
Make sure there is NOTHING else in any of the cells in columns B or C.
Best Answer
I'm not sure it's the right answer but when you need exact match always add a False in the last argument of the vlookup formula.
I never quite understood the differences of behavior with and without the last argument.
Anyway, Cell B15 is
=IF((ISBLANK(B14)); ; VLOOKUP(B14; 'Sheet Names'!$A$2:$D$20; 4))
Just add the False like this
=IF((ISBLANK(B14)); ; VLOOKUP(B14; 'Sheet Names'!$A$2:$D$20; 4; False()))
No more
#N/A