Formula help

  • Thread starter Thread starter Lovelock, David
  • Start date Start date
L

Lovelock, David

I am trying to compare the sum of two cells with 30, if that sum i
between zero and 30 I want to fill a value of 30 minus the sum of th
two cells, if the value of the two cells is greater than thirty the
this cell should be zero. I wrote the following formula to start wit
and it doesn't work, any ideas?:

=IF(0<(C33+C39)<30,30,0)

I figured if I could get this formula working then I could replace th
",30," with ((C33+C39)-30
 
David,

Try this

=IF(AND(C33+C39>0,C33+C39<30),30-C33-C39,0)

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
David

Sorry, I misread your question. Try this instead!

=IF(AND(C33+C39>0, C33+C39<30),30-(C33+C39),0)

Andy
 
Thanks Andy, I didn't even consider that but in this case it works jus
fine (I added -1*(MIN(0,C33+C39-30)) to it to get the correct value).

Is there a function for BETWEEN or can you do a comparison liek I ha
asked about before? I have not found it and was curious in case I ru
into a different circumstance requiring it.

Thanks for the help!:
 
Thanks for the suggestions. I am going to use the =IF(AND(C33+C39>0
C33+C39<30),30-(C33+C39),0)

so that I can reference it for other situations!!!
 

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

Back
Top