Resetting a fibonacci sequence

davidalexander1959

New Member
Joined
Dec 27, 2020
Messages
4
Office Version
  1. 365
Platform
  1. Windows
I have a very simple problem but I just can't figure it out. There are two columns. The left column has random 0 and 1 going down to 5000. The right column has the sequence starting at 10,10, 20, 30, 50, 80, 130, 210.
It's a betting sequence. A loss is a 0 and a win is a 1. Whenever the left column shows a 0 the bet increases until a win or the sequence reaches 210 when the sequence restarts at 10 in the row following the 1 or win. I have the formula sorted to start the sequence but when it resets. Column A has the 1 and 0. Column B is the sequence that needs to run. Column D has my formula I have started creating. As you can see it starts out ok. When it resets it is starting at 10 again but the next cell down should be another 10 to start the sequence off again. My formula adding the two above and putting the answer in D13. The 220 needs to be the second 10 to start the sequence again.

Thank you,
David

Roulette 123.xlsx
ABCDE
1010
2010
31200
40101010
501010
602020
703030
805050
908080
100130130
110210210
1201010
13110220
1402010
15130230
1601010
17010240
18020250
19130490
2001010
21010500
22020510
230301010
240501520
250802530
2601304050
2702106580
2801010630
29
30 =IF(OR(D3=210,A3=TRUE),$E$4,SUM(D2+D3))
Sheet2
Cell Formulas
RangeFormula
D3:D28D3=IF(OR(D2=210,A2=1),$E$4,SUM(D1+D2))
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
You don't need columns D & E.
Put in B3 :
=IF(B2=210,10,B2+((B1<>210)*B1))

Perhaps I've misunderstood what you want to do.
 
Upvote 0
You don't need columns D & E.
Put in B3 :
=IF(B2=210,10,B2+((B1<>210)*B1))

Perhaps I've misunderstood what you want to do.
Thank you for your reply. Unfortunately your formula didn't work. When I have the correct formula it will match Column B meaning D4 will go into B4, D5 into B5. Column B is how the sequence is suppose to come out. Column D has my formula but as you can see the cells highlighted in orange should be the second 10 in the fibonacci sequence. When the formula in Col D is correct it will match Col B. Eventually my formula will go in Column B. Sorry I don't think I've drawn up my sheet very well. See below for new version.
My formula is adding the first two cells directly above creating and resetting the fibonacci sequence but the orange cell is adding the 210 and 10 above to give 220. The sequence is working correctly except for the total in the orange cells. If that total in the orange cells was the second 10 then the sequence will run again. I think I need another IF to place the second 10 in the sequence. The sequence I want to run is 10,10, 20, 30, 50, 80, 130, 210 but the second 10 in the sequence is adding the first 10 and 210 from the end of the sequence or whatever is the last number in the sequence before it resets.
Column B shows how it is suppose to run. See how the numbers in the blue cells are the final number in the sequence. Reset to 10, 10, 20, 30, and so on until a win or it reaches 210. Reset.

Hope that is a little clearer.

Thanks,
David
Roulette 123.xlsx
ABCD
40101010
501010
602020
703030
805050
908080
100130130
110210210
1201010
13110220
1402010
15130230
1601010
17010240
18020250
19130490
2001010
21010500
22020510
230301010
240501520
250802530
2601304050
2702106580
2801010630
29
30 =IF(OR(D3=210,A3=TRUE),$E$4,SUM(D2+D3))
Sheet2
Cell Formulas
RangeFormula
C4:C28C4=IF(OR(C3=210,A3=1),$D$4,SUM(C2+C3))
 
Upvote 0
Sorry. Big mistake. A13 is suppose to be 0. Disregard the last sheet. See new one. If you change the orange cells C13, C17, C21 to 10 the sequence works.

Roulette 123.xlsx
ABC
401010
501010
602020
703030
805050
908080
100130130
110210210
1201010
13010220
14020230
15130450
1601010
17010460
18020470
19130930
2001010
21010940
22020950
230301890
240502840
250804730
2601307570
27021012300
2801019870
Sheet2
Cell Formulas
RangeFormula
C4:C28C4=IF(OR(C3=210,A3=1),10,SUM(C2+C3))
 
Upvote 0
I have finally figured it out. This is the formula I came up with.

Excel Formula:
=IF(OR(C3=210,A3=1),10,IF(AND(C3=10,C2<>10),10,SUM(C2+C3)))

Your formula footoo =IF(B2=210,10,B2+((B1<>210)*B1)) helped me on the right track so thank you for that.

This is resolved.
 
Last edited by a moderator:
Upvote 0
Solution

Forum statistics

Threads
1,214,942
Messages
6,122,366
Members
449,080
Latest member
Armadillos

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top