+ Reply to Thread
Results 1 to 4 of 4

Thread: Formula with multiple if statement

  1. #1
    Registered User
    Join Date
    12-17-2007
    Posts
    1
    i'm looking @ doing something similar... but instead i'm looking at putting a "cancellation system" into excel.
    http://www.excelforum.com/excel-programming/612303-formula-with-multiple-if-statement.html

    Here is an example:

    You start with 1 1 1 1 1 1 1 1 1 1.
    You then wager two units and win, cross off the 1 on the left and right, leaving 1 1 1 1 1 1 1 1.
    You then wager another two units and lose, adding a 2 to the right, leaving 1 1 1 1 1 1 1 1 2.
    You then wager three units (1+2) and lose again, adding a 3 to the right, leaving 1 1 1 1 1 1 1 1 2 3.
    You then wager four units (1+3) and win, crossing off the 1 on the left and the 3 on the right, leaving 1 1 1 1 1 1 1 2 .

    I've tried EVERYTHING .. but can't seem to get it into excel... please help
    Last edited by VBA Noob; 12-17-2007 at 02:00 PM.

  2. #2
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    MS 2007
    Posts
    5,372
    Here you go. I set it up in 3 columns; Column A has your wager scheme, B has the amount you should bet, and C (manual input) is whether you won or lost.

    In A3, the formula is
    =IF(C2="Win",MID(A2,3,LEN(A2)-4),IF(C2="Loss",A2&" "&B2,""))
    which removes the first and last digit if you win and adds your last wager to the end if you lost

    In B3, the formula is
    =IF(ISERROR(LEFT(A3,1)+RIGHT(A3,1)),"",LEFT(A3,1)+RIGHT(A3,1))
    which sums the first and last digit of your new wager scheme. ISERROR is necessary to prevent error codes in rows you haven't gotten to yet.

    Let me know if you have any questions.

    ChemistB
    (Not responsible for any losses incurred while running this program)
    Attached Files Attached Files
    Last edited by ChemistB; 12-17-2007 at 05:08 PM.

  3. #3
    Registered User
    Join Date
    01-14-2012
    Location
    london
    MS-Off Ver
    Excel 2003
    Posts
    1

    Re: Formula with multiple if statement

    Hi ChemistB
    Thank you for this, very helpful.
    Just one point, is there any way with this methodology that you can make the system go above 10. Currently if you exceed 10 losses the wager column reverts back to '1'. Similarly the wager string when going over 10 is not showing.
    Any thoughts
    Regards
    Mark

  4. #4
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    Excel 2007
    Posts
    6,219

    Re: Formula with multiple if statement

    hi markinsurrey, please read forum rules:


    2. Don't post a question in the thread of another member -- start your own. If you feel it's particularly relevant, provide a link to the other thread.
    "Relax. What is mind? No matter. What is matter? Never mind!"

+ 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.2.0