Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
EG EG is offline
external usenet poster
 
Posts: 38
Default Tweaking a current 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 entered
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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 644
Default Tweaking a current formula

=If(Left(G20,1) = "h",If(And(G210,G21<=60),G21*(49/12),
I'm not sure how to handle all the conditions but that should get you
going.

Charles

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 entered
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


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 40
Default Tweaking a current formula

Post in the appropriate group please. This is the programming group
not the worksheet functions group.

Thanks.


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 entered
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


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 470
Default Tweaking a current formula

Try this formula. I have not tested it. I assume that if G20="s", you use
the original formula. So I checked for "s" first. If G1<"s", then I check
for the condition you specify for "h".

=IF(LEFT(G20,1)="s", ROUND(G21*(45/12)), IF(AND(G210, G21<=60,
G20="h"),ROUND(G1*(49/12)),ROUND(G21*(49/12)+5*(30/12)))

Hope this works,
Les

"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 entered
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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with tweaking formula Johndb Excel Worksheet Functions 5 July 24th 09 11:28 PM
Tweaking formula? Richard Excel Discussion (Misc queries) 2 August 14th 06 12:52 PM
Golf Score Formula needs tweaking kevhatch Excel Discussion (Misc queries) 2 April 29th 06 12:48 AM
Tweaking Code Richard Excel Programming 3 February 25th 06 07:15 PM
Formula needs tweaking - HELP!! PM Excel Programming 9 November 28th 03 09:13 AM


All times are GMT +1. The time now is 06:54 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"