Results 1 to 9 of 9
Thread: My If statement

030204, 11:38 #1Registered User
 Join Date
 Feb 2004
 Location
 Vermont
 Posts
 53
Unanswered: My If statement
My if statment is as follows, but I keep getting an error message. Can you tell me what I am doing wrong?
=If(D14<45), ((D1430)*75 + 45), If(AND(D14>45)(D14<120), ((D1460)*75) + 65, If(D14>120),((D14120)*75)+125CAT :D

030204, 12:02 #2Registered User
 Join Date
 Jan 2004
 Location
 Aberdeen, Scotland
 Posts
 1,067
Re: My If statement
Originally posted by carley465
My if statment is as follows, but I keep getting an error message. Can you tell me what I am doing wrong?
=If(D14<45), ((D1430)*75 + 45), If(AND(D14>45)(D14<120), ((D1460)*75) + 65, If(D14>120),((D14120)*75)+125
This Formula should work for you.
=IF(D14<45,((D1430)*75+45),IF(AND(D14>45,D14<120),((D1460)*75) + 65,((D14120)*75 +125)))
David

030204, 14:05 #3Registered User
 Join Date
 Feb 2004
 Location
 Vermont
 Posts
 53
Re: My If statement
This didn't work either. Although I didn't get an error message. The rules are if D14 is less than 45 do formula 1, if D14 is greater than 45 but less than 120 do formula 2 and if D14 is greater than 120 then do formula 3.
So that means if D14 is equals let's say 68 it would come up with this result would be 71.
Maybe I don't need the and statement???
C
Originally posted by DavidCoutts
Hi
This Formula should work for you.
=IF(D14<45,((D1430)*75+45),IF(AND(D14>45,D14<120),((D1460)*75) + 65,((D14120)*75 +125)))
DavidCAT :D

030204, 22:21 #4Registered User
 Join Date
 Feb 2004
 Posts
 3
IF(D14<45,((D1430)*75+45),IF(AND(D14>45,D14<120),((D1460)*75)+65),(D14120)*75 +125)))

030404, 09:06 #5Registered User
 Join Date
 Feb 2004
 Location
 Vermont
 Posts
 53
Originally posted by goodthing44
IF(D14<45,((D1430)*75+45),IF(AND(D14>45,D14<120),((D1460)*75)+65),(D14120)*75 +125)))
So if cell D14 = 68 why do I get a value of 665 with this formula. I should get a value of 71.CAT :D

030404, 09:46 #6Registered User
 Join Date
 Oct 2003
 Posts
 1,091
Your condition is if it more than 45 and less than 120 then the formula is:
(D1460)*75 + 65
With 68 as the entry in D14 you get:
(6860)*75 + 65 = 8*75 + 65 = 600 + 65 = 665old, slow, and confused
but at least I'm inconsistent!
Rich
(retired Excel 2003 user, 3/28/2008)
How to ask a question on forums

030404, 10:50 #7Registered User
 Join Date
 Oct 2003
 Posts
 1,091
I did a little experimenting. Is "75" in your formulas signifying percent? I suspect that it is. When I changed the number to 0.75 and used that as the multiplier, then with 68 in D14 the result would be 71.
old, slow, and confused
but at least I'm inconsistent!
Rich
(retired Excel 2003 user, 3/28/2008)
How to ask a question on forums

030404, 14:16 #8Registered User
 Join Date
 Feb 2004
 Location
 Vermont
 Posts
 53
Originally posted by shades
I did a little experimenting. Is "75" in your formulas signifying percent? I suspect that it is. When I changed the number to 0.75 and used that as the multiplier, then with 68 in D14 the result would be 71.
If a client had let's say 68 minutes for the month price is then determine the following way.
if less than 60 mins they are billed for anything over 30 mins at $.75 per min with a min charge of $45. Anything over 60 but less than 120 mins they are billed $.75/min plus a min. charge of $65 and if the total min for the month are over 120 mins they are billed $.75/min plus $125
So this would mean the client that had a total of 68 mintues would pay.
((6830)*.75)+45=$73.50 that the customer would pay for this month.
CATCAT :D

030404, 15:23 #9Registered User
 Join Date
 Oct 2003
 Posts
 1,091
Guess, I'm confused now.
Originally posted by carley465
So if cell D14 = 68 why do I get a value of 665 with this formula. I should get a value of 71.
Originally posted by carley465
No what is occuring is this.
If a client had let's say 68 minutes for the month price is then determine the following way.
if less than 60 mins they are billed for anything over 30 mins at $.75 per min with a min charge of $45. Anything over 60 but less than 120 mins they are billed $.75/min plus a min. charge of $65 and if the total min for the month are over 120 mins they are billed $.75/min plus $125
So this would mean the client that had a total of 68 mintues would pay.
((6830)*.75)+45=$73.50 that the customer would pay for this month.
CAT
Originally posted by carley465
=If(D14<45), ((D1430)*75 + 45), If(AND(D14>45)(D14<120), ((D1460)*75) + 65, If(D14>120),((D14120)*75)+125old, slow, and confused
but at least I'm inconsistent!
Rich
(retired Excel 2003 user, 3/28/2008)
How to ask a question on forums