IF function, nested with 2 source cells?

P

Patrick R

Hi, This may be simple, but I'm trying to assign a % to a sales item, but I
ma having issues:

The value of cell C33 is 30%, the value of C10 is 46%

If I use the formula =IF(C22>0,C33,C10), provided that the value of C22 is
greater than zero, the result is C33. That all works fine.
If I use the formula =IF(C29>C25,C10,C33) in the next cell, I can assign
those %s according to the value in Cell C25. That works fine on its own.

How do I combine them so that if C22 is greater than zero the result will be
30%, less than zero 46% and if C29 is greater than the value in C25 the
result will be 46%, otherwise 30%?

Thanks for your help
 
P

Pete_UK

I think you want something like this:

=IF(C22<0,C10,IF(C22>0,C33,IF(C29>C25,C10,C33)))

Hope this helps.

Pete
 
P

Patrick R

Pete, thanks, but here is the problem. There is a state where C22 can be
greater than zero at the same time as C29 being greater than C25, so there is
a conflict. I only want the result to be C33 if C>0 but not if C29>C25,
otherwise the result should be C10. Does that make sense?
 
S

Spiky

Pete, thanks, but here is the problem. There is a state where C22 can be
greater than zero at the same time as C29 being greater than C25, so there is
a conflict. I only want the result to be C33 if C>0 but not if C29>C25,
otherwise the result should be C10. Does that make sense?

So, there is only one way for the answer to be 30%? Then only one IF
should be necessary.
=IF(AND(C22>0,C25>=C29),C33,C10)
 
P

Patrick R

Spiky, thanks. That did the trick. The only way for the result to be 30%
(i.e C33) was for C22 to be greater than zero AND C29 less than C25. Thanks
for the help.
 

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