Forum Discussion
Excel formula help
I'd like to create a formula that either sums columns D2 through H2 OR D2-G2 plus I2. In other words, for the second option I want it to skip H2. Can this be done and if so how do I do it? Screen shot attached.
21 Replies
- PJKCICopper Contributor
If only one or the other of H2 or I2 has a non-zero value, i.e., a student could't have marks in both Option 1 and Option 2, then just using the formula
=SUM(D2:I2)
should always work.
- ahmad aliBrass Contributor
in this case you can try this: =IF(H2>0,SUM(D2:H2),D2+F2+G2+I2)
- SergeiBaklanDiamond Contributor
That could be
=SUM(D2:CHOOSE(<skip H2?>+1,I2,G2))
where <skip H2?> is formula/value for your logical condition
- prr924Copper Contributor
Sorry, that didn't work. Let me try to explain this better. I want a formula for cell C2 (Total Score) that does this:
IF H2>0, then C2 =SUM(D2:H2).
If H2<1, then C2 =SUM(D2,F2,G2,I2).
- ahmad aliBrass Contributor
Hello,
I'm sorry but are you aware that IF H2=0.5 ( or 0.2, ...) the two conditions are accepted ?
they intersect!