ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Modifying a Formula (https://www.excelbanter.com/excel-discussion-misc-queries/109963-modifying-formula.html)

EG

Modifying a Formula
 
I have the following formula that multiplies the number entered in G21 by
either 49/12 or 45/12 depending if the first letter in G20 is "h" or "s".
=ROUND(IF(LEFT(G20,1)="h",(49/12)*G21,IF(LEFT(G20,1)="s",(45/12)*G21))

I would like to modify this so that the above is true for numbers enter into
G21 that are 60 or less but greater than 0. Then, for every amount more than
60, i would like it to add 30/12 times that amount. For example:

if the number entered into G21 is 50 and G20 is "h", then the answer would be:
50*(49/12)=204.16 or 204 (rounded)

if the number entered into G21 is 65 and G20 is "h", then the anwer would be:
60*(49/12)+5*(30/12)=

Can anyone give me a little help with this?

Thanks,
EG

Don Guillett

Modifying a Formula
 
I'm kind of dense sometimes and you didn't give enough examples to test but
try

=G21*(IF(G20="s",45,49)+MAX((G21-60)*30,0))/12

--
Don Guillett
SalesAid Software

"EG" wrote in message
...
I have the following formula that multiplies the number entered in G21 by
either 49/12 or 45/12 depending if the first letter in G20 is "h" or "s".
=ROUND(IF(LEFT(G20,1)="h",(49/12)*G21,IF(LEFT(G20,1)="s",(45/12)*G21))

I would like to modify this so that the above is true for numbers enter
into
G21 that are 60 or less but greater than 0. Then, for every amount more
than
60, i would like it to add 30/12 times that amount. For example:

if the number entered into G21 is 50 and G20 is "h", then the answer would
be:
50*(49/12)=204.16 or 204 (rounded)

if the number entered into G21 is 65 and G20 is "h", then the anwer would
be:
60*(49/12)+5*(30/12)=

Can anyone give me a little help with this?

Thanks,
EG




Sandy

Modifying a Formula
 
Try this, it's pretty long and very nested but it seems to work if I
understood you correctly. I left in "all are false" in the last if
statement, put in what ever you'd like if all your criteria are false

Sandy


=ROUND(IF(AND(LEFT(G20,1)="h",G210,G21<60),(49/12)*G21,IF(AND(LEFT(G20,1)="h",G2160),(60*(49/12))+((G21-60)*(30/12)),IF(LEFT(G20,1)="s",(45/12)*G21,"all
are false"))),0)


EG wrote:
I have the following formula that multiplies the number entered in G21 by
either 49/12 or 45/12 depending if the first letter in G20 is "h" or "s".
=ROUND(IF(LEFT(G20,1)="h",(49/12)*G21,IF(LEFT(G20,1)="s",(45/12)*G21))

I would like to modify this so that the above is true for numbers enter into
G21 that are 60 or less but greater than 0. Then, for every amount more than
60, i would like it to add 30/12 times that amount. For example:

if the number entered into G21 is 50 and G20 is "h", then the answer would be:
50*(49/12)=204.16 or 204 (rounded)

if the number entered into G21 is 65 and G20 is "h", then the anwer would be:
60*(49/12)+5*(30/12)=

Can anyone give me a little help with this?

Thanks,
EG



EG

Modifying a Formula
 
Thanks for your reply! I am not sure what you mean by "all are false".
could you explain further?

Thx, EG

"Sandy" wrote:

Try this, it's pretty long and very nested but it seems to work if I
understood you correctly. I left in "all are false" in the last if
statement, put in what ever you'd like if all your criteria are false

Sandy


=ROUND(IF(AND(LEFT(G20,1)="h",G210,G21<60),(49/12)*G21,IF(AND(LEFT(G20,1)="h",G2160),(60*(49/12))+((G21-60)*(30/12)),IF(LEFT(G20,1)="s",(45/12)*G21,"all
are false"))),0)


EG wrote:
I have the following formula that multiplies the number entered in G21 by
either 49/12 or 45/12 depending if the first letter in G20 is "h" or "s".
=ROUND(IF(LEFT(G20,1)="h",(49/12)*G21,IF(LEFT(G20,1)="s",(45/12)*G21))

I would like to modify this so that the above is true for numbers enter into
G21 that are 60 or less but greater than 0. Then, for every amount more than
60, i would like it to add 30/12 times that amount. For example:

if the number entered into G21 is 50 and G20 is "h", then the answer would be:
50*(49/12)=204.16 or 204 (rounded)

if the number entered into G21 is 65 and G20 is "h", then the anwer would be:
60*(49/12)+5*(30/12)=

Can anyone give me a little help with this?

Thanks,
EG




Sandy

Modifying a Formula
 
Just that nothing meets the criteria (or logical_test) in the first "IF
statement". If you do not enter in a criteria in the "[value_if_false]"
section of a IF statement , the value that excel will give you in that
cell will be "FALSE" if nothing matches your logical test.
In your cell what would you like the formula to return if you had a
value of "j" in cell G20? This is where you'd put that value.

For example
In cell A1 you have the value of "2"

In this IF statement if no values match your logical test excel returns
"FALSE"
=IF(A1=4,"Cell A1 matches 4")

In this IF statement if no values match your logical test excel returns
"Cell A1 does not match 4""
=If(A1=4,"Cell A1 matches 4","Cell A1 does not match 4")

Hope this explains more, good luck.

Sandy


EG wrote:
I have the following formula that multiplies the number entered in G21 by
either 49/12 or 45/12 depending if the first letter in G20 is "h" or "s".
=ROUND(IF(LEFT(G20,1)="h",(49/12)*G21,IF(LEFT(G20,1)="s",(45/12)*G21))

I would like to modify this so that the above is true for numbers enter into
G21 that are 60 or less but greater than 0. Then, for every amount more than
60, i would like it to add 30/12 times that amount. For example:

if the number entered into G21 is 50 and G20 is "h", then the answer would be:
50*(49/12)=204.16 or 204 (rounded)

if the number entered into G21 is 65 and G20 is "h", then the anwer would be:
60*(49/12)+5*(30/12)=

Can anyone give me a little help with this?

Thanks,
EG




All times are GMT +1. The time now is 01:55 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com