IF-Then formula problem

B

Bill Elerding

I am using the attached formula, but need to modify it to within a range.
Here is the existing formula:

Formula =IF((M2-L2>0),(ROUND(((M2-L2)*1440),0))," ")
I need to have the first IF statement to me like this, where MaxTAT=180
(for now):

Revision =IF((MaxTAT>M2-L2>0),(ROUND(((M2-L2)*1440),0))," ") I want the
formula to round the answer if M2-L2 is between 0 and 180, or leave it blank
if not. When I put the formula in as this, it appears to only consider the
M2-L2>0 part of the formula. Am I missing something REALLY basic here?

Thanks for any help. Bill in Northern California
 
M

Max

Believe you meant to do this:
=IF(AND(M2-L2>0,M2-L2<MaxTAT),ROUND((M2-L2)*1440,0),"")

[Using an AND construct, and with extra parens removed]
 
P

Pete_UK

You need to amend your formula like this:

=IF(AND(MaxTAT>M2-L2,M2-L2>0),ROUND((M2-L2)*1440,0)," ")

I've also removed two pairs of redendant brackets.

Hope this helps.

Pete
 
B

Bill Elerding

Thanks, Max. It worked like a charm. -Bill

Max said:
Believe you meant to do this:
=IF(AND(M2-L2>0,M2-L2<MaxTAT),ROUND((M2-L2)*1440,0),"")

[Using an AND construct, and with extra parens removed]

Bill Elerding said:
I am using the attached formula, but need to modify it to within a range.
Here is the existing formula:

Formula =IF((M2-L2>0),(ROUND(((M2-L2)*1440),0))," ")
I need to have the first IF statement to me like this, where MaxTAT=180
(for now):

Revision =IF((MaxTAT>M2-L2>0),(ROUND(((M2-L2)*1440),0))," ") I want the
formula to round the answer if M2-L2 is between 0 and 180, or leave it blank
if not. When I put the formula in as this, it appears to only consider the
M2-L2>0 part of the formula. Am I missing something REALLY basic here?

Thanks for any help. Bill in Northern California
 
B

Bill Elerding

Great, thanks for the help. Of course, once I put in the fix, I had to also
remember to multiply the M2-L2 by 1440 to convert the times back to minutes.
Sometimes the simplest things... -Bill
 
P

Pete_UK

Yes, I thought you were doing something with time. Glad to hear you
got it to work.

Pete
 

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