To find the differences assingned to a particular name

Viewed 47
1 Answers

This is easily done with VLOOKUPs.

  1. Some quality of life stuff: use named ranges.
    1. Ordered - Sheet1!C5:D8
    2. Received - Sheet1!F5:G8
    3. BalanceNames - Sheet1!I5:I8
  2. In your quantity column:
=ArrayFormula(IFNA(
  VLOOKUP(BalanceNames,Ordered,2,0)-
  VLOOKUP(BalanceNames,Received,2,0)
))

If you have multiple items in your list and want to sum them, this is similar, but a bit more complex:

=ArrayFormula(IFNA(
HLOOKUP(BalanceNames,QUERY(Ordered,"select sum(D) pivot C"),2,0)-
HLOOKUP(BalanceNames,QUERY(Received,"select sum(G) pivot F"),2,0)
))

We can use a Query pivot to sum the data. This gives a horizontal range, so it would be best to use HLOOKUP.

Related