d2jsp
Log InRegister
d2jsp Forums > Off-Topic > Computers & IT > Programming & Development > Excel: Sum Alternating Cells Under A Condition > Good Luck
Add Reply New Topic New Poll
Member
Posts: 6,344
Joined: Jan 5 2003
Gold: 1,730.01
Sep 27 2012 01:09pm
How would you sum a range of cells that alternates (skips every other cell) depending on the value of the cell to its left (the every other cell)'s value being non-zero?

Example:
Sum b1 (if a1 is nonzero), d1 (if c1 is nonzero), and f1 (if e1 is nonzero)
Member
Posts: 32,925
Joined: Jul 23 2006
Gold: 3,804.50
Sep 27 2012 02:37pm
pretty sure there is a sumif function.
Member
Posts: 6,344
Joined: Jan 5 2003
Gold: 1,730.01
Sep 27 2012 04:26pm
i found the sumif but it only seems to favor cells next to eachother with a simple range like A1:A10
remember my range is every other cell, requiring additional formulae
Member
Posts: 16,144
Joined: Mar 27 2008
Gold: 14,618.00
Sep 28 2012 05:04am
add another variable: h

let h be 1 if (a1>0), else let h be 0.
then multiply b1 by h and sum those values.

i bet you can put these equations then into one formula, if you don't want "h" to be in your excel. (don't know excel's syntax very vell)
Go Back To Programming & Development Topic List
Add Reply New Topic New Poll