Vlookup Calculations

R

RBG

Not sure if a Vlookup is the right function but this is my situation: On one
worksheet i have a row of column headers and on the second worksheet i have
the data. I want to compose a formula where I can lookup the column header
from the first worksheet on the second and then if found, take the difference
between two columns on the second spreadsheet.
 
J

John Bundy

If you are wanting to do a vlookup using headers and the data is on a set
row, you want to look into the Hlookup function, a lot like vlookup but works
horizontally.
 
R

RBG

Maybe an illustration would better explain what I am trying to: I am trying
to lookup an item from worksheet 1 on worksheet 2 and if found i want to
calculate the difference between gross and net without having to add an
additional column on worksheet 2 for the difference. Thanks

Worksheet 1
Computers Laptops Ipods


Worksheet 2
Item Gross Net
Computers 25 15
Laptops 10 5
Ipods 17 3
 
M

Mike H

If as it seems you only have a single entry for computers etc in your second
sheet then this would work.

=SUMPRODUCT((Sheet3!A1:A10="Computers")*(Sheet3!B1:B10-Sheet3!C1:C10))

Mike
 
Top