I have a lookup table in Excel with ColA and ColB :
ColA ColB ColC
va 1 value1
ColC is the actual value table
I need to do a wildcard lookup with lookup_value = "value1"
I need to perform an operation that if the value of ColC matches the characters in ColA then it should return me ColB value, i.e. 1
I want to use wildcards in the lookup function to achieve this result.
Any help will be appreciated!
Thanks
You can use wildcards with VLOOKUP. You'll have to rearrange your table so that the lookup column is the first column, but other than that it should work. I put:
abc 1
def 2
ghi 3
jkl 4
into a range named "table"
Then:
g*
g?i
?kl
into F2:F4
Now, in G2:G4, I put this formula:
=VLOOKUP(F2,table,2,FALSE)
and it correctly found 3 in cells G2 & G3, and 4 in cell G4.
The asterisk means zero or more characters; the question mark means exactly one character.
This works as a wild card with text strings:
=vlookup("*"&REF&"*",lookup range, column, false)
It turns a number into text to do a wild card on a number. Stars should go between the quotations but they are not showing up.
You can do it this way:
=VLOOKUP(LOOKUP("value1",ColC:ColC,ColC:ColC), lookuprange, COLUMN(ColA) + 1, TRUE)
Of course you can simplify this with your domain knowledge.
This method allows you to use your lookup table as is.
Related
I want to fill in one cell with text based on another cell that has a number. So for example if A1 reads 2 I want B1 to read Correct.
In my case I have multiple possible criteria, B1 = Correct is just ONE example.
Will this be a conditional format formula involving an IF function or vlookup possibly?
Basically what I'm looking to do is IF A1 = 2, than B1 = Text
Thanks in advance for an answer to this
Use a VLOOKUP formula
to do this you need a table of key and value
for example
in the range d1:E6 you have the lookup table.
Lookup LookupValue
1 May be correct
2 Don't know
3 It depends
4 probably correct
5 My wife says it is correct
In the range a1:c7 you have your data
col1 col2 col3
kjkjk 2 Don't know
klkl 2 Don't know
jkljkjk 1 May be correct
kjukjkjk 4 probably correct
lklklkl 5 My wife says it is correct
lklklkl 3 It depends
in col3 you use the VLOOKUP
as =VLOOKUP(B2, MyLookupTable, 2)
Note that I named the d1:e6 range as MyLookupTable
THis is what it looks like
I want find a formula who allows to check like this :
column 1 :
row 1 : "AAA AA ABB A"
...
column 2 :
row 1 : "LLL BBLL"
...
the formula return TRUE with rows 1 of the two columns because there is "BB"
I don't want search "BB" but find if two rows are "similare" like this example.
Thanks you =)
Is it possible via formula ? (no vb)
This is maybe possible with the following approach:
This is a German Excel. WAHR=TRUE and FALSCH=FALSE ;-)
Formulas in
C4:
{=NOT(AND(ISERROR(FIND(MID($A4,ROW($A$1:INDEX($A:$A,LEN($A4)-$C$2+1)),$C$2),$B4))))}
and in D4:
{=NOT(AND(ISERROR(SEARCH(MID($A4,ROW($A$1:INDEX($A:$A,LEN($A4)-$C$2+1)),$C$2),$B4))))}
These are array formulas. Input them in the cell without the curly brackets and the press [Ctrl]+[Shift]+[Enter] to complete.
The approach is to get an array of $C$2 length substings from string in column A and find/search them in the string in column B.
I have a few columns in a sheet. First column being first names and the fifth being their respective age. If I want to search the age column for a particular age say '12' and return their corresponding first names in a separate sheet, what should i do? I tried VLOOKUP but I could not figure out the logic. Can someone help me out?Thank you.
Unfortunately VLOOKUP will not work in this situation,as the Vlookup function cannot reference details on left side, however you can use a combination of INDEX and MATCH functions thou. Lets say you have following table
A B
mark 11
john 23
Selly 30
Youbaraj 45
and you want to get the value of A based on the value of B, you can use something like
=INDEX(A1:A20,MATCH(1,B1:B20,0))
You can use index and match to do HLOOKUP and VLOOKUP looking into any column and getting values of any side.
You can use an Index and Double match .. to get answers from a column by entering its name.
Example:
A B C D
1 col1 col2 col3 col4
2 val1 val2 val3 val4
3 val5 val6 val7 val8
Consider in cell C10 ColumnName:
And in cell C11, you enter the name of a column
Now see what would happen with this function
=index(A1:D3,Match(C11,A1:D1,0),Match(val-to-look-for, Column (a,b,c,d),0))
You can dynamically type a name of a column to get that column name's look up value
Vlookup is very easy to use, however the first column must be arranged alphabeticaly before in order for it to work properly. (and usualy i use only the exact match argument).
So i have the main data table:
ColA ColB ColC ColD
aa 1 0 1
bb 1 2 2
cc 1 2 3
Row aa, bb, cc, etc. The total number of rows shouldn't be larger than a couple of hundred .
A second sheet\collumn has a table that list only the relevant column's helper, adaptable on the fly:
Helper
ColB
ColD
The search helper tells the functions which columns i should use in the search.
The idea is to sum all values from columns that are refered in the Helper table and that match the unique identifier in "ColA".
So the result would, using the above Helper table:
Identifier aa, would return 2.
Identifier BB, would return 3.
Identifier CC, would return 4.
Any idea how to do it.
You can do this with VLOOKUP, IF and SUM:
IF(VLOOKUP(C1,$H1:$H99,1)=C1, SUM(C2:C99), "")
Enter this formula with Control+Shift+Enter to make it an array formula.
=SUM(($A$2:$A$4="aa")*((($B$2:$B$4)*NOT(ISNA(MATCH($B$1,rngHelper,FALSE))))+(($C$2:$C$4)*NOT(ISNA(MATCH($C$1,rngHelper,FALSE))))+(($D$2:$D$4)*NOT(ISNA(MATCH($D$1,rngHelper,FALSE))))))
I need a formula to return the value of Data for the last match of "Text". Row number is also acceptable. Macro is NOT acceptable. Name column is unsorted and cannot be sorted!
Only column "Name" is used as lookup value. I would rather use a/multiple helper column(s) instead of an array formula.
Row Name Data
1 Joe 10
2 Tom 20
3 Eva 30
4 Adam 40
5 Tom 21
LARGE only works with numbers, and VLOOKUP only returns the first match. LOOKUP only works sometimes, so its out too.
So if I wanted the last match for "Tom" then it should return "21".
Array formulas could be avoided with a helper column.
Suppose to have in F1 the name to match (i.e. Tom)
In the helper column row C2 enter
=IF(A2<>$F$1,0,row())
Then copy the formulas along your data.
Now the column C contains 0 for the unmatched names and the row number for the matched ones. Maxing the column yield the row of the solution.
Now the result is simple a matter of using the correct offset with the function offset:
=OFFSET(B1,max(C:C)-1,0)
PS: my copy of excel is in italian, so I can't test this english translaction of the formulas.
I think it's the easiest way to make it.
=LOOKUP("Tom";A2:B7)
Create a column with an array formula (enter it with Ctrl+Shift+Enter):
=VLOOKUP(MAX(IF($B$2:$B$6=B2, $A$2:A$6, 0)), $A$2:$C$6, 3, FALSE)
To make sure you did it right, click on the cell, and the formula should be shown encased in curly brackets ({}).
Note: This assumes that "Row" is in A1.
I have come up with a solution, but it requires that numbers in Data are concurrent, like so
Name Data
Joe 1
Tom 1
Eva 1
Adam 1
Tom 2
Tom 3
Eva 2
But thats okay, since that my data looks like that anyway. So if Name is used before then it must be the old highest +1 aka concurrent.
Name is A1 and Data is B1, and this formula goes into C2:
FLOOR(SQRT(2*SUMIF(A2:A7,A2,B2:B7)),1)