View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.newusers
Paula_p
 
Posts: n/a
Default help with vlookup formula

Dave, That formula gives a #REF error.

After looking at all the all the help that were being suggested, i realised
that i didn't know what match and index does, so after some research i tried
tracing the formulas i was given, and i came up with this;

MATCH, takes a value, a range to be searched, and returns the position of
the value.

INDEX, takes a range, a row number, and a column number, and the result is
the actual value in the intersection.

The value that match returns, is it used as a row number or column number?
And since index requires two values, is one value missing from the formula,
or am i reading and tracing it wrong?


"Dave Peterson" wrote:

One mo

=H6-INDEX(Invoice!$A$16:$A$32,MATCH(B6,Invoice!$b$16:$ B$32,0))



Paula_p wrote:

Hi,
I have two worksheets, an invoice, and an inventory. What i need is to be
able to deduct quantity sold (from the invoice) from the quantity in stock
(in the inventory). I tried using a vlookup formula to get the product code
from the invoice and subtract the quantity sold from an amount bought and
recorded in the invetory list. The formula is as follows:
=H6-(VLOOKUP(B6,Invoice!$A$16:$B$32,1,TRUE)). However, this only reduces the
amount by 3, whether or not the amount sold is 3. Does anyone know what i'm
doing wrong? Please, any help is appreciated.

Column H - has the anount of goods bought and is available for sale.
Column B - has the unique probuct code.

In the invoice sheet,
Column A - has the quantity sold
Column B - has the code

Thank You.


--

Dave Peterson