Need Help solving this equation

D

DeerSpotter

=IF((SUMIF(K25,"<0",K25))then(K25+P22+P21))*orIF((SUMIF(K25,">0",K25))then(K25-(P22+P21)))

i am familiar with VBA a little... i understand the "or if" command i
not in excel i just put it in so you guys could understand what i a
trying to accomplish
 
G

GS

=IF((SUMIF(K25 said:
i am familiar with VBA a little... i understand the "or if" command
is not in excel i just put it in so you guys could understand what i
am trying to accomplish.

Firstly, this is *not* VBA!

Secondly, you can use the OR() function in cell formulas. Look it up
and see what it does and how it works.

Thirdly, I can't give you a sample formula because I can't make sense
of this example's use of the SUMIF() function. If using XL2007 or later
perhaps the SUMIFS() function would better suit your needs!

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion
 
J

joeu2004

DeerSpotter said:
=IF((SUMIF(K25,"<0",K25))then(K25+P22+P21))
*orIF((SUMIF(K25,">0",K25))then(K25-(P22+P21)))

i understand the "or if" command is not in excel i just
put it in so you guys could understand what i am
trying to accomplish.

Does this do what you want?

=IF(K25<0, K25+P22+P21, K25-(P22+P21))

Note: You do not cover the case when K25=0. As written, my formula will
return -(P22+P21) in that case. If you to return P22+P21, change K25<0 to
K25<=0.
 

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