+ Reply to Thread
Results 1 to 5 of 5

Excel If Statements, please help!

  1. #1
    Registered User
    Join Date
    12-08-2005
    Posts
    2

    Exclamation 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

  2. #2
    JE McGimpsey
    Guest

    Re: 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 <[email protected]>,
    izzie <[email protected]> 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


  3. #3
    Registered User
    Join Date
    12-08-2005
    Posts
    2
    Quote Originally Posted by JE McGimpsey
    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(G10>0, M7+G10-M7*G10, M7+G10+M7*G10, IF(G11>0, M7+G11-M7*G11, M7+G11+M7*G11, G7*0.5))

    and it said I had to many arguments.

  4. #4
    JE McGimpsey
    Guest

    Re: 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(G10>0, ..., ...), G10 is either >0 or it's not. Adding the
    additional terms is why you got the error.


    In article <[email protected]>,
    izzie <[email protected]> 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(G10>0, M7+G10-M7*G10, M7+G10+M7*G10, IF(G11>0, M7+G11-M7*G11,
    > M7+G11+M7*G11, G7*0.5))
    >
    > and it said I had to many arguments.


  5. #5
    JR
    Guest

    RE: 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(M7>0,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
    >
    >


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1