Home |
Search |
Today's Posts |
#1
![]() |
|||
|
|||
![]()
Ok...Here goes. Finally got this really nice IF statement to work:
=IF(A2(6/7), 1, IF(A2(5/7), 2, IF(A2(4/7), 3, IF(A2(3/7), 4, IF(A2(2/7), -1, IF(A2(1/7), -2, 0)))))) This is in cell B2 Assigns a value to a random number in A2, and gives seven different outputs of +1, +2, +3, +4, -1, -2, -ALL What I want to be able to do is have one cell keep like a running total. That is, start a cell at zero (we'll say C2), then if the random number is between 6/7 and 1, add 1 to the C2. Then when i hit F9 again and a new value comes up, for example, the random number is between 4/7 and 5/7, add 3 to C2 so that now it says 4. Is this possible? I tried: =IF(A2(6/7), C2=(C2+1), IF(A2(5/7), C2=(C2+2), IF(A2(4/7), C2=(C2+3), IF(A2(3/7), C2=(C2+4), IF(A2(2/7), C2=(C2-1), IF(A2(1/7), C2=(C2-2), 0)))))) And other variations. Also tried in C2 : =$C$2+B2 and =C2+B2 but those just start a circular reference. Thanks for any help. |
#2
![]() |
|||
|
|||
![]()
There's nothing wrong with a circular reference, but you need to be able to
manage it. Go to Tools|Options|Calculation, check Iteration, change Maximum iterations to 1 and Maximum change to 4. -- Ian -- "Logan" wrote in message ... Ok...Here goes. Finally got this really nice IF statement to work: =IF(A2(6/7), 1, IF(A2(5/7), 2, IF(A2(4/7), 3, IF(A2(3/7), 4, IF(A2(2/7), -1, IF(A2(1/7), -2, 0)))))) This is in cell B2 Assigns a value to a random number in A2, and gives seven different outputs of +1, +2, +3, +4, -1, -2, -ALL What I want to be able to do is have one cell keep like a running total. That is, start a cell at zero (we'll say C2), then if the random number is between 6/7 and 1, add 1 to the C2. Then when i hit F9 again and a new value comes up, for example, the random number is between 4/7 and 5/7, add 3 to C2 so that now it says 4. Is this possible? I tried: =IF(A2(6/7), C2=(C2+1), IF(A2(5/7), C2=(C2+2), IF(A2(4/7), C2=(C2+3), IF(A2(3/7), C2=(C2+4), IF(A2(2/7), C2=(C2-1), IF(A2(1/7), C2=(C2-2), 0)))))) And other variations. Also tried in C2 : =$C$2+B2 and =C2+B2 but those just start a circular reference. Thanks for any help. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Excel 2003 FAILS, but Excel 2000 SUCCEEDS ??? | Excel Discussion (Misc queries) | |||
How can I replace 2 of 5 characters within an cell in MS Excel? | Excel Worksheet Functions | |||
How can I copy Word data into a merged cell in Excel? | Excel Discussion (Misc queries) | |||
Fetching External Data from Excel | Excel Discussion (Misc queries) | |||
GET.CELL | Excel Worksheet Functions |