Adding and subtracting many columns numbers

W

WoodyAccess

My column B is entitled "No. in Stock". These boxes contain the quantity of a
certain product that we have in stock.

My columns E and G are entitled "Used" and "Delivered" respectively. These
column are repeated in H and J, K and M etc etc

What I want to happen is that when a number is put in E it is subtracted
from B and then G is added to B.

Is there a shorter way of doing this rather than typing in
=(-E5+G5)+(-H5+J5)+(-K5+M5) etc etc because in the row 5 there could be up to
50 different sections

Thanks
WoodyAccess
 
R

Roger Govier

Hi

Assuming your headings are in row 4, enter in B5

=SUMPRODUCT((E$4:Z$4="Delivered")*E5:Z5)-SUMPRODUCT((E$4:Z$4="Used")*E5:Z5)

Change the ending column from Z in each case to whatever you want.
Change the row identifier from 4 to whatever row you use for the
"Delivered" and "Used".
 

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

Top