ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Excel If Statements, please help! (https://www.excelbanter.com/excel-worksheet-functions/59483-excel-if-statements-please-help.html)

izzie

Excel If Statements, please help!
 

I've been trying to make multiple IF statements but it says that I have
too many arguements. The problem is, I need to have a calculation for
my work.

Here's what I need to be done

For example:

If G7 is changed, then M7 needs to change to what G7 is times 0.5

Then, if G10 is changed M7 also needs to be changed. However, if M7 is
greater that zero this equation needs to be done M7+G7-M7*G7
If M7 is less than zero, this equation needs to be done M7+G7+M7*G7

Then, if G11 is changed, M7 also needs to be changed and the same rules
above apply.

Can anyone help me to do this please? I've been trying for ages and I
can't find a solution.

Many thanks

Izzie


--
izzie
------------------------------------------------------------------------
izzie's Profile: http://www.excelforum.com/member.php...o&userid=29491
View this thread: http://www.excelforum.com/showthread...hreadid=491912


JE McGimpsey

Excel If Statements, please help!
 
I may be just being dim, but I think you'll have to provide more
information.

It sounds like your first example should just be to put

=G7/2

in M7. You then say the if G10 is changed, M7 needs to be changed, too,
but you describe a formula that uses M7 - so what exactly are you
wanting to be changed when G10 changes? To change M7, say, to

=M7+G7-M7*G7

you'll need to use an event macro (formulas can't change other formulas)
and you'll get a circular reference as well.

If you instead mean that G10 should change if M7 changes, you could use

G10: =M7+G7-G7*ABS(M7)

which, since M7 is just G7/2 means that you could use the equivalent:

G10: =G7*(1.5-ABS(G7/2))






In article ,
izzie wrote:

I've been trying to make multiple IF statements but it says that I have
too many arguements. The problem is, I need to have a calculation for
my work.

Here's what I need to be done

For example:

If G7 is changed, then M7 needs to change to what G7 is times 0.5

Then, if G10 is changed M7 also needs to be changed. However, if M7 is
greater that zero this equation needs to be done M7+G7-M7*G7
If M7 is less than zero, this equation needs to be done M7+G7+M7*G7

Then, if G11 is changed, M7 also needs to be changed and the same rules
above apply.

Can anyone help me to do this please? I've been trying for ages and I
can't find a solution.

Many thanks

Izzie


izzie

Excel If Statements, please help!
 

JE McGimpsey Wrote:
I may be just being dim, but I think you'll have to provide more
information.

It sounds like your first example should just be to put

=G7/2

in M7. You then say the if G10 is changed, M7 needs to be changed,
too,
but you describe a formula that uses M7 - so what exactly are you
wanting to be changed when G10 changes? To change M7, say, to

=M7+G7-M7*G7

you'll need to use an event macro (formulas can't change other
formulas)
and you'll get a circular reference as well.

If you instead mean that G10 should change if M7 changes, you could
use

G10: =M7+G7-G7*ABS(M7)

which, since M7 is just G7/2 means that you could use the equivalent:

G10: =G7*(1.5-ABS(G7/2))





Yeah, sorry, I didn't explain myself properly. I do need M7 to change
once the other fields have been updated according to that equation. How
do I use an event macro?

Originally, what I did was this:

=IF(G100, M7+G10-M7*G10, M7+G10+M7*G10, IF(G110, M7+G11-M7*G11,
M7+G11+M7*G11, G7*0.5))

and it said I had to many arguments.


--
izzie
------------------------------------------------------------------------
izzie's Profile: http://www.excelforum.com/member.php...o&userid=29491
View this thread: http://www.excelforum.com/showthread...hreadid=491912


JE McGimpsey

Excel If Statements, please help!
 
I'm still not clear on what you're trying to accomplish.

What cell do you want this to go into? If M7, then do you really want
circular references if G10 or G11 <0?

What should happen if *both* G10 and G11 are <0?

The IF() function has the form

=IF(condition, TRUE branch, FALSE branch)

i.e., in =IF(G100, ..., ...), G10 is either 0 or it's not. Adding the
additional terms is why you got the error.


In article ,
izzie wrote:

Yeah, sorry, I didn't explain myself properly. I do need M7 to change
once the other fields have been updated according to that equation. How
do I use an event macro?

Originally, what I did was this:

=IF(G100, M7+G10-M7*G10, M7+G10+M7*G10, IF(G110, M7+G11-M7*G11,
M7+G11+M7*G11, G7*0.5))

and it said I had to many arguments.


JR

Excel If Statements, please help!
 
You could still if statements, just use more cells so you don't get a
circular reference. It sounds like M7 could always be G7*1.5. In M8, put in
If(M70,M7," "), then have G10 refer to M8 and G11 refer to M9, etc.

"izzie" wrote:


I've been trying to make multiple IF statements but it says that I have
too many arguements. The problem is, I need to have a calculation for
my work.

Here's what I need to be done

For example:

If G7 is changed, then M7 needs to change to what G7 is times 0.5

Then, if G10 is changed M7 also needs to be changed. However, if M7 is
greater that zero this equation needs to be done M7+G7-M7*G7
If M7 is less than zero, this equation needs to be done M7+G7+M7*G7

Then, if G11 is changed, M7 also needs to be changed and the same rules
above apply.

Can anyone help me to do this please? I've been trying for ages and I
can't find a solution.

Many thanks

Izzie


--
izzie
------------------------------------------------------------------------
izzie's Profile: http://www.excelforum.com/member.php...o&userid=29491
View this thread: http://www.excelforum.com/showthread...hreadid=491912




All times are GMT +1. The time now is 01:33 AM.

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