#1   Report Post  
MCrum
 
Posts: n/a
Default If Command

How do I use a "IF" comaand. I have a value for instance in A1 and a value in
A2. If the value increases in A1 by more than 20 I need to add another value
from A3 to A2 and get a total in B1. If over 40 I need to add A3 again etc..

Any help would be good.
  #2   Report Post  
Sandy Mann
 
Posts: n/a
Default

A2. If the value increases in A1 by more than 20

If you mean that there is some arbitrary value in A1 and if this arbitrary
value increases by 20 then you will need VBA event code to do this because
otherwise you will get a circular reference error because you will be trying
to refer to the previous value in A1 and the present value in A1.

If you mean when the value in A1 increases TO more than 20 then in B1 try:

=IF(A1<"",A2+INT(A1/20)*A3,"")


--
HTH

Sandy

Replace@mailinator with @tiscali.co.uk


"MCrum" wrote in message
...
How do I use a "IF" comaand. I have a value for instance in A1 and a value
in
A2. If the value increases in A1 by more than 20 I need to add another
value
from A3 to A2 and get a total in B1. If over 40 I need to add A3 again
etc..

Any help would be good.



  #3   Report Post  
MCrum
 
Posts: n/a
Default

OK I got it to work with this formula. Now I need it to be =40, =60, etc. I
keep cetting a "Value" in cell
This works
=IF(C5=20,SUM(B39*2),B39)

I thought it s/b like this but it does not work
=IF(C5=20,SUM(B39*2),B39),IF(C5=40,SUM(B39*3),B3 9),IF(C5=60,SUM(B39*4),B39)))

"MCrum" wrote:

How do I use a "IF" comaand. I have a value for instance in A1 and a value in
A2. If the value increases in A1 by more than 20 I need to add another value
from A3 to A2 and get a total in B1. If over 40 I need to add A3 again etc..

Any help would be good.

  #4   Report Post  
Ragdyer
 
Posts: n/a
Default

Try this:

=IF(C5=60,B39*4,IF(C5=40,B39*3,IF(C5=20,B39*2,B 39)))

--
HTH,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------
"MCrum" wrote in message
...
OK I got it to work with this formula. Now I need it to be =40, =60, etc.

I
keep cetting a "Value" in cell
This works
=IF(C5=20,SUM(B39*2),B39)

I thought it s/b like this but it does not work

=IF(C5=20,SUM(B39*2),B39),IF(C5=40,SUM(B39*3),B3 9),IF(C5=60,SUM(B39*4),B3
9)))

"MCrum" wrote:

How do I use a "IF" comaand. I have a value for instance in A1 and a

value in
A2. If the value increases in A1 by more than 20 I need to add another

value
from A3 to A2 and get a total in B1. If over 40 I need to add A3 again

etc..

Any help would be good.


  #5   Report Post  
Sandy Mann
 
Posts: n/a
Default

Ragdyer" wrote in message
... Try this:

=IF(C5=60,B39*4,IF(C5=40,B39*3,IF(C5=20,B39*2,B 39)))



=MIN(INT(C5/20)+1,4)*B39

Seems to return the same results
--
Regards


Sandy

Replace@mailinator with @tiscali.co.uk


"




  #6   Report Post  
MCrum
 
Posts: n/a
Default

Worked Great. Thanks So Much

"Ragdyer" wrote:

Try this:

=IF(C5=60,B39*4,IF(C5=40,B39*3,IF(C5=20,B39*2,B 39)))

--
HTH,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------
"MCrum" wrote in message
...
OK I got it to work with this formula. Now I need it to be =40, =60, etc.

I
keep cetting a "Value" in cell
This works
=IF(C5=20,SUM(B39*2),B39)

I thought it s/b like this but it does not work

=IF(C5=20,SUM(B39*2),B39),IF(C5=40,SUM(B39*3),B3 9),IF(C5=60,SUM(B39*4),B3
9)))

"MCrum" wrote:

How do I use a "IF" comaand. I have a value for instance in A1 and a

value in
A2. If the value increases in A1 by more than 20 I need to add another

value
from A3 to A2 and get a total in B1. If over 40 I need to add A3 again

etc..

Any help would be good.



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
Extract Command in Excel 1 Bethetsu Excel Discussion (Misc queries) 1 May 12th 05 02:19 PM
Why do Command Buttons get stacked after print preview? thall22963 New Users to Excel 1 April 5th 05 09:07 PM
Help requested for an Excel Toolbar command Deanl5 Excel Discussion (Misc queries) 2 January 17th 05 01:01 AM
Excel has a "Find Next" command but no "Find Previous" command. Michael Fitzpatrick Excel Discussion (Misc queries) 2 January 10th 05 11:45 PM
command button in excel will move when print. [email protected] Excel Discussion (Misc queries) 1 December 29th 04 03:53 PM


All times are GMT +1. The time now is 11:05 PM.

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

About Us

"It's about Microsoft Excel"