adding result of "if" statement..

X

Xiamen

I have created this "if" statement.
=IF(G17=(166719),"1", IF(G17=(165852),"2", IF(G17=(165851),"0",
IF(G17=(166718),"1", IF(G17=(166685),"4", IF(G17=(166745),"0", IF(G17=(""),""
)))))))

Now i want to add the result of this statement from consecutive rows.
i did sum on the results but i am not able to add the results of my
statements.

can you tell me how i can add the results of this statement?
 
M

Mike H

Try it like this

=IF(G17=(166719),1, IF(G17=(165852),2, IF(G17=(165851),0,
IF(G17=(166718),1, IF(G17=(166685),4, IF(G17=(166745),0, IF(G17=(""),""
)))))))
--
Mike

When competing hypotheses are otherwise equal, adopt the hypothesis that
introduces the fewest assumptions while still sufficiently answering the
question.
 
F

Fred Smith

And you don't need all the parentheses. And you should have something to say
what you want if none of the tests are true. If you're happy with 0 in this
case, use:

=IF(G17="","",IF(OR(G17=166718,G17=166719),1,IF(G17=16582,2,IF(G17=166685,4,0))))

Regards,
Fred
 
Z

Ziggy

And you don't need all the parentheses. And you should have something to say
what you want if none of the tests are true. If you're happy with 0 in this
case, use:

=IF(G17="","",IF(OR(G17=166718,G17=166719),1,IF(G17=16582,2,IF(G17=166685,4­,0))))

Regards,
Fred









- Show quoted text -

I might consider controlling the cell with an Index/Match from a table.
 

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