excel lookup in multiple columns - excel

I have below 2 sheets.
Sheet 1
id review_name
1 Test1
2 Test2
3 Test3
Sheet 2
Review_name Date_range
Test1 B2:B248
Test2 AC2:A248
Test3 U2:U248
Here the Date_range refers to column names in sheet3.I should pick the review names and based on the above date_range(column range) of sheet 3,i should look for matching value.
Expected result
Col1 Col2 Col3
1 test1 LOOKUP(1,Sheet3A2:A248,<Here i should use sheet2 lookup date_range>
Any suggestions, i used concatenate of sheet name and the range, like LOOKUP(1,Sheet3A2:A248,Sheet3&B2:B248) but dint work

You'll need function =INDIRECT() to convert a string holding a sheet/range name into an actual range. Otherwise it just stays as a string which is meaningless. In your case something like:
=lookup(A1, Sheet3!A2:A248, indirect("Sheet3!" & vlookup(B1, Sheet2!A:B, 2, false)))
That last parameter of your lookup function is going to concatenate the string Sheet3! to the results of the vlookup, which will be the string range in Column B of Sheet2. That is then interpreted by indirect() into an actual range that will function in your lookup() formula.

Related

Apply VLookup on all sheets of excel file in one shot along with description

I have a Data in ExcelFile 1 which look something like this
COl A
1
2
3
4
5
6
I have another excel file 'ExcelFile2' which contains over 50 sheets .
The data in this file contains two column - COlA is similar to ColA of ExcelFile1 and Col2 is Description .
My requirement is to Check what data in ExcelFile1 is matching from any sheet in ExcelFile2 and find what is the description from Col2 in ExcelFile2
Applying VLookup on each sheet will take forever . Is there a simpler automated way of achieving this ?
Looking for the help on this as soon as possible
To Vlookup multiple sheets at a time, carry out these steps:
Write down all the lookup sheet names somewhere in your workbook and name that range (Lookup_sheets in our case).
Adjust the generic formula for your data. In this example, we'll be:
searching for A2 value (lookup_value)
in the range A2:A6 (lookup_range) in four worksheets (s1, s2, s3, s4), and
pull matching values from column B, which is column 2 (col_index_num) in the data range A2:C6 (table_array).
With the above arguments, the formula takes this shape:
=VLOOKUP($A2, INDIRECT("'"&INDEX(Lookup_sheets, MATCH(1, --(COUNTIF(INDIRECT("'"& Lookup_sheets&"'!$A$2:$A$6"), $A2)>0), 0)) &"'!$A$2:$C$6"), 2, FALSE)
This is an array forumula so Ctrl+Shift+Enter

Use Excel to look for 2 string values over 2 columns and in one row and return the cell value if there is a match on either of the lookup strings

I would like to have some help with creating an MS Excel 2013 formula that would do the following.
It should look for two string values over 2 columns in one row and should return the cell value of the cell in which the string value was found.
Sorry if I am not explaining myself correctly. Here is an example of the dataset and my expected result
My Dataset have 2 columns A and B but I would like only 1 output in C if ocn OR ocm exist.
I would like to use this formula to normalise this data set.
A B C (Result for ocm or ocn)
(OCoLC)911180191 (OCoLC)ocn911180191 (OCoLC)ocn911180191
(OCoLC)ocn911180196 (OCoLC)911180196 (OCoLC)ocn911180196
(OCoLC)911495338 (OCoLC)ocm911495338 (OCoLC)ocm911495338
(OCoLC)ocm794701569 (OCoLC)794701569 (OCoLC)ocm794701569
Click to see a picture of what I am trying to do
In C2 Cell
=IF(SUM(COUNTIF(A2,{"*ocn*","*ocm*"})),A2,IF(SUM(COUNTIF(B2,{"*ocn*","*ocm*"})),B2,""))
Or
=IFERROR(LOOKUP(2,1/MATCH({"*ocn*","*ocm*"},A2:B2,0),A2:B2),"")
Or
=IFERROR(LOOKUP(2,1/SEARCH({"*ocn*","*ocm*"},A2:B2),A2:B2),"")
Or
=IF(SUMPRODUCT(--ISNUMBER(SEARCH({"*ocn*","*ocm*"},A2))),A2,IF(SUMPRODUCT(--ISNUMBER(SEARCH({"*ocn*","*ocm*"},B2))),B2,""))
Drag the C2 Cell formula down.

How to fill in a cell with text based on a value

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

Excel, Get count if two cells have specifice value

i have an excel sheet with some test result(PPV Predictive Positive Value) like below, i want to find out the count if
Test1=1 Test2=1 count is 2
Test1=1 Test2=0 count is 1
Test1=0 Test2=1 count is 1
Test1=0 Test2=0 count is 1
Let's assume your table starts in A1 cell. Write this in C2 cell:
=MAX(A2+B2,1)
Or if you are a Boolean maniac:
=AND(A2;B2)+1
Then count the sum at the bottom of the column.
If Test1 is in col A and Test2 is in col B, you could use a countifs formula like =countifs(A:A,1,B:B,1) for your first condition. Then, =countifs(A:A,1,B:B,0), =countifs(A:A,0,B:B,1), and =countifs(A:A,0,B:B,0) for your others.
The formula works by looking in col A for the condition you specify(1 or 0) and doing the same for col B, then only counting the ones that meet both criteria.

VLOOKUP for multiple entries

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).

Resources