IF FUNCTION, ADD MULTIPLE NUMBERS

B

BELL

HI,

WHAT CAN I DO? THIS IS MY FORMULA

=(IF((OR(G8=32,H8=32,I8=32)),C8-26,(IF((OR(G8=40,H8=40,I8=40)),C8-2,(IF((OR(G8=50,H8=50,I8=50)),C8-50,(IF((OR(G8=65,H8=65,I8=65)),C8-60,(IF((OR(G8=100,H8=100,I8=100)),C8-70,IF(G8=100,C8-80,0)))))))))))

I NEED FOR ALL THE OUTCOMES TO BE ADDED TOGETHER AS ONE NUMBER AND TAKEN
AWAY FROM C8.

ANY IDEAS??
 
D

David Biddulph

Firstly, please get your caps lock key repaired so that you can stop
SHOUTING.
Secondly, your formula looks particularly confusing because you have many
unnecessary sets of parentheses.
=IF(OR(G8=32,H8=32,I8=32),C8-26,IF(OR(G8=40,H8=40,I8=40),C8-2,IF(OR(G8=50,H8=50,I8=50),C8-50,IF(OR(G8=65,H8=65,I8=65),C8-60,IF(OR(G8=100,H8=100,I8=100),C8-70,IF(G8=100,C8-80,0))))))
would do.
Thirdly, you refer to wanting "ALL THE OUTCOMES TO BE ADDED TOGETHER AS ONE
NUMBER", but I don't know what you mean by "all the outcomes". You have a
nested IF statement which returns one outcome. The other point is that with
the way you've got the nesting, your final IF function is unnecessary;
G8=100 is one of the conditions for the OR in the previous IF condition, so
if G8=100 you satisfy the conditions for that previous IF statement and thus
don't proceed to the alternative outcome, which is the final IF.

You may want to reformulate your statement and explain what it is that you
are trying to achieve.
 
B

Bernard Liengme

Let's look at a simpler problem to start with
=OR(G8=32,H8=32,I8=32)*(C8-26)+OR(G8=40,H8=40,I8=40)*(C8-2)

If any of G8,H8 or I8 has value 32, we add C8-26 to our sum
If any of G8,H8 or I8 has value 40, we add C8-2 to our sum
So if C8 has value 60, and G8 is 32 while H8 is 40, our sum is 92

If this is correct fro you then just extend the formula being careful with
parentheses
 

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