# Simple or Complicated Sequencing Formula?

#### MrDentist

##### New Member
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!

#### Joe4

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

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
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
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

You are welcome. Glad we could help.

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

1,082,305
Messages
5,364,401
Members
400,800
Latest member
germanpbv

### This Week's Hot Topics

• populate from drop list with multiple tables
Hi All, i have a drop list that displays data, what i want is when i select one of those from the list to populate text from different tables on...
• Find list of words from sheet2 in sheet1 before a comma and extract text vba
Hi Friends, Trying to find the solution on my task. But did not find suitable one to the need. Here is my query and sample file with details...
• Dynamic Formula entry - VBA code sought
Hello, really hope one of you experts can help with this - i've spent hours on this and getting no-where. .I have a set of data (more rows than...