View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Roger Govier Roger Govier is offline
external usenet poster
 
Posts: 2,886
Default Adding and subtracting many columns numbers

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".



--
Regards

Roger Govier


"WoodyAccess" wrote in message
...
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