Vlookup with If statement

  • Thread starter Thread starter tr2usa
  • Start date Start date
T

tr2usa

I have two worksheets and I would like to find the value from second
file and bring it to first file with Vlookup and if statement in
col_section. Here is the data. Thanks for the help.
Worksheet
A B C D
E F
ITEMNO CUBICMETER EXTWEIGHT HEIGHT LENGTH WIDTH
039ABZZ
039AZZZ
046ZZZZ
058AZZZ
059AZZZ
060050N
060060N
060070N
060080N
060090N


Worsheet 2 has the data this way;
A B C
ITEMNO OPTFIELD VALUE
039ABZZ CUBICMETER 1.11
039ABZZ EXTWEIGHT 20
039ABZZ HEIGHT 15
039ABZZ LENGTH 16
039ABZZ WIDTH 12
039AZZZ CUBICMETER 1.11
039AZZZ EXTWEIGHT 15
039AZZZ HEIGHT 12
039AZZZ LENGTH 6
039AZZZ WIDTH 6
046ZZZZ CUBICMETER
 
Since the value in column C of the second sheet is numeric, you could use a
pivottable to create a summary report that looks like the table in the first
sheet.

Select the table on worksheet 2 (A1:Cxx)
data|pivottable
follow the wizard until you get a dialog with a Layout button on it.
click that layout button

drag the itemno to the row field
drag the optfield to the column field
drag the value to the data field
If that value says "count of", double click on it and choose Sum.

Then finish up that wizard.
 
If your data started on both sheets in A2 with headers in A1, with
sheet names as Sheet1 and Sheet2, this is your formula:

=IF((VLOOKUP(A2,Sheet2!A2:C11,2,FALSE))=B1,(VLOOKUP(A2,Sheet2!A2:C11,3,FALSE)),"")
 
If your data started on both sheets in A2 with headers in A1, with
sheet names as Sheet1 and Sheet2, this is your formula:

=IF((VLOOKUP(A2,Sheet2!A2:C11,2,FALSE))=B1,(VLOOKUP(A2,Sheet2!A2:C11,3,FALSE)),"")
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top