Simple or Complicated Sequencing Formula?

MrDentist

New Member
Joined
May 24, 2018
Messages
2
Hi all,

I need to know if theres a way you can make a formula for the parameters below-

Plus 9 except when reaching a multiple of 10, then plus 10 then plus 19 then carry on with plus 9.

For example-

12512, 12521, 12530, 12540, 12559, 12568, 12577.

Many thanks if this can be done! Don't know how complicated or easy it would be!
 

Some videos you may like

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).

Joe4

MrExcel MVP, Junior Admin
Joined
Aug 1, 2002
Messages
55,882
Office Version
  1. 365
Platform
  1. Windows
Welcome to the Board!

Let's say that you have the number 12512 in cell A1.

Then place this formula in cell A2:
Code:
=A1+IF(RIGHT(A1,1)="0",10,9)
and then this formula in cell A3, and copy down as far as you want:
Code:
=A2+IF(RIGHT(A2,1)="0",10+IF(RIGHT(A1,1)="0",9,0),9)
 

Jeffrey Mahoney

Well-known Member
Joined
May 31, 2015
Messages
1,830
Office Version
  1. 365
Platform
  1. Windows
Please try this:

Put 12512 in cell A2
put this formula starting in Cell A3: =IF(AND(MOD(A2,10)=0,MOD(A1,10)=0),A2+19,IF(MOD(A2,10)=0,A2+10,A2+9))
copy down
 

Finalfight40

Active Member
Joined
Apr 24, 2018
Messages
273
Office Version
  1. 365
Platform
  1. Windows
Maybe try:

Assuming the first 2 cells of data are already filled in A4 and B4 and copy across:

=IF(B4-A4=10,B4+19,IF(MOD(B4,10)=0,B4+10,B4+9))
 

MrDentist

New Member
Joined
May 24, 2018
Messages
2
Welcome to the Board!

Let's say that you have the number 12512 in cell A1.

Then place this formula in cell A2:
Code:
=A1+IF(RIGHT(A1,1)="0",10,9)
and then this formula in cell A3, and copy down as far as you want:
Code:
=A2+IF(RIGHT(A2,1)="0",10+IF(RIGHT(A1,1)="0",9,0),9)

Many thanks buddy,

You're a lifesaver! Works perfectly!
 

Joe4

MrExcel MVP, Junior Admin
Joined
Aug 1, 2002
Messages
55,882
Office Version
  1. 365
Platform
  1. Windows
You are welcome. Glad we could help.

As you can see, there are multiple different formulas that will work.
 

Watch MrExcel Video

Forum statistics

Threads
1,122,228
Messages
5,594,939
Members
413,953
Latest member
Arthur1471

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
Top