I cannot append these rows because the list would get too large. I have every city, village etc in this sheet and its UN code. I want to Vlookup on an another sheet and match the UN code to POD(name of a place). How can I Match several columns?
I have tired:
=INDEX((codes!$B$2:$B$51112) * (codes!$F$2:$F$27403) * (codes!$L$2:$L$33880);MATCH(0;(codes!$C$2:$C$5112=E4)*(codes!$G$2:$G$27403=E4)*(codes!$M$2:$M$33880=E4);FALSE))
But I get #VALUE! error
Here I have managed to lookup some city UN codes because they were in the first two coumns with POD and UN code. But how do I get the rest of columns?
You can partition a range using INDEX and array constants. You will also need to use XLOOKUP instead of HLOOKUP or VLOOKUP, because you need to do both.
=XLOOKUP("c",INDEX(A1:D2,,{1,3}),INDEX(A1:D2,,{2,4}))
Use one such array for the lookup value (all the rows, columns 1 and 3) and another for the return value (all the rows, columns 2 and 4).
I found it easier to just directly Vlookup from the sheet where I had these cities. And do lookups for each of the columns and than just unite the columns with strings. But for some reason I couldn't find UN codes for all of the cities. I just filled them manually
Related
this is my first question so I will try my best to format this.
I would like to use the vlookup function in more than just one column. It seems impossible to do is in the formula for the large data set, so maybe someone with VBA knowledge can help me.
In my excel file I've two spreadsheets:
Sheet1 with one column "A" with 16868 different processes ID's.
Sheet2 with columns from "A" to "HX", where "A:HW" are different processes ID's (each column have different numbers of rows) and in "HX" column I have a region for the particular row of processes.
What I am trying to achieve is to do vloop for sheet1 column "A" that will look for each record in table sheet2 and return "HX" when found it.
In example:
I'm looking for "A2" cell in sheet1 in table_array sheet2 "A:HX". If found it then return cell in the same row but from column "HX". The trick here is when the looking value is not in the sheet2 column "A", then it should vlookup in column "B", then "C" and so on till "HW". There is an option where the looking value might not be in sheet2 at all and then the formula should return "0".
Is it possible to do this in VBA or excel formula?
Firstly, please NEVER use VLOOKUP. Ever.
An INDEX/MATCH combination is always better in every way. It is faster, more flexible and more robust as it does not break if you insert columns. It is also (arguably) easier to use as you do not need to count columns.
Anyway, back to the problem at hand. You can use an INDEX/SUMPRODUCT combination for this:
=INDEX(<range of return values>),SUMPRODUCT(--MAX((<range to search in>=<value to search for>)*ROW(<range to search in>)))-(ROW(<range to search in>)-1))
The SUMPRODUCT returns the last row number where the value is found.
The last bit -(ROW(<range to search in>)-1) is just to make the returned value relative to the searched range (rather than an absolute row number.
The INDEX is then uses this value to select a value from the HX column.
I have a large Excel table (with circa 9133 rows) which contains 4 columns. On a separate column, i have a series of values (300 cells to be exact) which i wanna search on the larger table and return the rows which have those values in the first column. What is the simplest way to achieve this instead of applying the filter and having to select the values manually?
You can Use INDEX, MATCH formula.
=INDEX($B$3:$E$7,MATCH($G3,$B$3:$B$7,0),COLUMNS($B$3:C$3))
As screenshot enter formula in H3 cell and drag and drop both down and right.
You can use VLOOKUP to get this. Assuming your original list is in A2:D9134
and your shorter list is in G1:G300,
in the next column write
=VLOOKUP(G1, $A$2:$D$9134, 2, false)
in subsequent columns,use the same formula,but change 2 to 3 or 4.
You should get all the results.
If you want to show blanks where no match is found, use IFERROR().
I have two tables on separate sheets in the same workbook.
Trying to explain: I am trying to return the length in worksheet("LENGTHS") to worksheet("CONTROL"). Basically, if D3&E3 (Ex. L1a) matches worksheet("LENGTHS")B:B&C:C, return value in column D to worksheet("CONTROL")column G.
Worksheet("CONTROL")
Worksheet("LENGTHS")
I am able to match just the "REF:" columns with:
=IFERROR(INDEX(Table2[[#All],[Linear Length:]],MATCH([#[REF:]],Table2[[#All],[REF:]],0)),"")
However, I need to match the extensions in the adjacent column as well. I tried adding it with "&" but it returns a blank cell:
=IFERROR(INDEX(Table2[[#All],[Linear Length:]],MATCH([#[REF:]]&[#[(extension)]],Table2[[#All],[REF:]]&Table2[[#All],[Extension:]],0)),"")
Any suggestions appreciated. Writing a macro might take less space?
I am looking for returning multiple column values using multiple matching criteria.
Attached is a screenshot of sample sheet, which have my criteria on cell's B1 & C1.
So basically, when matching 2 criteria (example "Team1" & "low"), it should return columns header (example Name10 & name14) from the header ranger C3:N3.
I have tried a couple of formulas, and is is how far I gone: =INDEX($C$2:$AL$2,SMALL(IF(($A$3:$A$21=$B$1)*($B$3:$B$21=$C$1),ROW($A$3:$A$21)-ROW($A$3)+1),ROW(1:1)))
I am not sure what is missing?
enter image description here
enter image description here
Thanks in advance
Fox
First of all, in your example you point out row 3 and 4 but only one of the specified criteria are matched in this rows: low, because Team4 specifyed in the criteria it's not matched, so i will consider you are looking to match one OR both the criteria specified.
The only way i can imagine for do this with a formula is to use a formula like this
=SE(C3<>0;$C$2&", ";"")&SE(D3<>0;$D$2&", ";"")&SE(E3<>0;$E$2&", ";"")&SE(F3<>0;$F$2&", ";"")&SE(G3<>0;$G$2&", ";"")&SE(H3<>0;$H$2&", ";"")&SE(I3<>0;$I$2&", ";"")&SE(J3<>0;$J$2&", ";"") 'and so on...
where SE() it's function IF() in my language, with this formula in a column on the right of the table (for example col O) you will have a list of the names of that row where the corresponding number is different from 0...expand the formula down for all the rows and then, with a formula like this
=SE(O(A1=A3;B1=B3);O3;"")&SE(O(A1=A4;B1=B4);O4;"")&SE(O(A1=A5;B1=B5);O5;"")&SE(O(A1=A6;B1=B6);O6;"")&SE(O(A1=A7;B1=B7);O7;"") 'and so on...
with the function O() corresponding to OR() you will concatenate the strings (names) of the rows that match one OR both the criteria. If you whant to match both the criteria you should use AND() instead of OR().
The problem of this approach is that the formula becomes very long if you have a lot of names and a lot of rows, and if you add rows you have to modify the formula. Another problem is that if you match the same name more times it will be repeated in the list that the formula outputs...and the list of the names ends with a comma.
In fact, i can't tell that this is a good way for obtain what you need, but it's the only i can imagine only with formulas.
If you should use a macro the problem would be solved better and in a more flexible way, should you?
I have a large Excel dump from SQL with many columns of data. Two of those columns have different fields with various text values. There are six correct values for the first column and five correct values for the second column. I need to count the accounts (column A) that have both "correct" values.
Well, I just stumbled on this guy:
=COUNTIFS(A:A,"val1",B:B,"val2")
where:
A:A is the first column you have.
"Val1" is the valid value in the first column you want.
B:B is the 2nd column you have.
"Val2" is the valid value in the 2nd column you want.
Unfortunately, that only works if you have 1 value for each column .. and they work more like an AND .. not an OR.
So rather than that, I'd suggest a "helper column":
1) setup your list of valid values somewhere else, and name the lists: "validcol1" and "validcol2"
==IF(OR(ISERROR(MATCH(A2,validcol1,0)),ISERROR(MATCH(B2,validcol2,0))), "", "Valid!")
I solved it through and array that uses "find."
{ =SUM(1*(IFERROR(FIND(b1:b413,"0B,D,E,K,L,S"),0)>0)*(IFERROR(FIND(c1:c413,"0ZA,ZB,ZC,ZF,ZK"),0)>1))}
Note the use of the leading 0 at the start of each set of values.
It's my understanding hard-coding the values into the formula isn't ideal. Anyone have any ideas for that?