+ Reply to Thread
Results 1 to 9 of 9

Too Many Arguments? Can someone tidy up?

  1. #1
    Forum Contributor
    Join Date
    12-29-2012
    Location
    usa
    MS-Off Ver
    Excel 2016
    Posts
    325

    Too Many Arguments? Can someone tidy up?

    This is my function which returns too many functions because of the last IF statement. Anyway to get it all in?

    =IF(H2="AY",IF(C2>0,(C2/100)*1,1/(C2*-1)*1*100),IF(H2="HY",IF(F2>0,(F2/100)*1,1/(F2*-1)*1*100),IF(H2="T",0),-1)))

  2. #2
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591

    Re: Too Many Arguments? Can someone tidy up?

    Hi

    Can you explain what you are trying to get for what variables. As the function doesn't work, I don't know what it is you are trying to achieve.

    rylo

  3. #3
    Forum Contributor
    Join Date
    12-29-2012
    Location
    usa
    MS-Off Ver
    Excel 2016
    Posts
    325

    Re: Too Many Arguments? Can someone tidy up?

    Quote Originally Posted by rylo View Post
    Hi

    Can you explain what you are trying to get for what variables. As the function doesn't work, I don't know what it is you are trying to achieve.

    rylo
    The function works if you just take out the last if statement. So the function evaluates cell H2 for 3 different values. If it returns any of the first two it grabs a value from another cell and the division and stuff calculates betting odds based off of the number it grabs. The last if statement is simple. It evaluates cell H2 and if it returns a "T" I just want it to spit out a 0
    Last edited by nobodyukno; 01-17-2013 at 11:49 PM.

  4. #4
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591

    Re: Too Many Arguments? Can someone tidy up?

    Hi

    This calculates but I don't know if it does what you want.

    =IF(H2="AY",IF(C2>0,(C2/100)*1,1/(C2*-1)*1*100),IF(H2="HY",IF(F2>0,(F2/100)*1,1/(F2*-1)*1*100),IF(H2="T",0,-1)))

    rylo

  5. #5
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,938

    Re: Too Many Arguments? Can someone tidy up?

    This evaluates correctly, but I have noooo idea if it giving you what you need - test it...

    =IF(H2="AY",IF(C2>0,(C2/100)*1,1/(C2*-1)*1*100),IF(H2="HY",IF(F2>0,(F2/100)*1,1/(F2*-1)*1*100),IF(H2="T",0,-1)))

    the error was that the last if() had no "else do this" to it
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  6. #6
    Forum Contributor
    Join Date
    12-29-2012
    Location
    usa
    MS-Off Ver
    Excel 2016
    Posts
    325

    Re: Too Many Arguments? Can someone tidy up?

    With what you guys posted I am just getting false with no matter what I type. Let me break it down:

    Evaluate H2 for the following:

    AY - If yes, do this part of the formula: IF(C2>0,(C2/100)*1,1/(C2*-1)*1*100)
    HY - If yes, do this part of the formula: IF(C2>0,(C2/100)*1,1/(C2*-1)*1*100)
    T - If yes, put a 0
    If False, meaning none of the preceding options, then put a -1

  7. #7
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Too Many Arguments? Can someone tidy up?

    Maybe ...

    =IF(H2="AY", IF(C2 > 0, C2/100, -100/C2), IF(H2 = "HY", IF(F2 > 0, F2/100, -100/F2), IF(H2 = "T", 0, -1)))

    Are you trying to calculate the bet required to win a dollar based on betting line odds?
    Entia non sunt multiplicanda sine necessitate

  8. #8
    Forum Contributor
    Join Date
    12-29-2012
    Location
    usa
    MS-Off Ver
    Excel 2016
    Posts
    325

    Re: Too Many Arguments? Can someone tidy up?

    Quote Originally Posted by shg View Post
    Maybe ...

    =IF(H2="AY", IF(C2 > 0, C2/100, -100/C2), IF(H2 = "HY", IF(F2 > 0, F2/100, -100/F2), IF(H2 = "T", 0, -1)))

    Are you trying to calculate the bet required to win a dollar based on betting line odds?
    That works perfectly!

    The divisible stuff calculates the winnings of a bet based on the odds of cell C2.

    I'm entering Results into H2 which will then return the winnings in my formula cell based on the number of units bet which in the formula is one.

  9. #9
    Forum Contributor
    Join Date
    12-29-2012
    Location
    usa
    MS-Off Ver
    Excel 2016
    Posts
    325

    Re: Too Many Arguments? Can someone tidy up?

    Quote Originally Posted by shg View Post
    Maybe ...

    =IF(H2="AY", IF(C2 > 0, C2/100, -100/C2), IF(H2 = "HY", IF(F2 > 0, F2/100, -100/F2), IF(H2 = "T", 0, -1)))

    Are you trying to calculate the bet required to win a dollar based on betting line odds?
    That works perfectly!

    The divisible stuff calculates the winnings of a bet based on the odds of cell C2.

    I'm entering Results into H2 which will then return the winnings in my formula cell based on the number of units bet which in the formula is one.

+ 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