View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.misc
Lil[_2_] Lil[_2_] is offline
external usenet poster
 
Posts: 4
Default Multiple IF conditions then add cells together

Thanks for replying, I had trouble getting this to work, but another formula
given to me seems to be working well. Thanks for your reply
--
Lil


"MyVeryOwnSelf" wrote:

How do I do the following:
IF H7,J7,L7=6 is true, then add together G7,I7,K7. I want to add all
figures together that have a 6 in the adjacent column, and ignore
others or add zero.
How do I get this formula to drag across to the next column so that
the '6' changes to '7' but all else remains the same?


One way is to put this in M7 and drag rightward.
=$G7*($H7+7=COLUMN())+
$I7*($J7+7=COLUMN())+
$K7*($L7+7=COLUMN())

It doesn't use an IF; hope that's ok.

The main idea is that the column number where the formula resides
determines the test number: 6, 7, 8, etc. M is column number 13.

Notice that if you put a logical result like ($H7+7=COLUMN()) into an
arithmetic expression, TRUE is treated as 1 (one), FALSE as 0 (zero).


Also will the formula work if I have 7 columns of numbers and 7
columns of figures?


Instead of having a sum of 3 terms, like above, expand it to 7 terms.