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!
 

Joe4

MrExcel MVP, Junior Admin
Joined
Aug 1, 2002
Messages
51,493
Office Version
365
Platform
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,604
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
251
Office Version
365
Platform
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
51,493
Office Version
365
Platform
Windows
You are welcome. Glad we could help.

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

Forum statistics

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

Some videos you may like

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...
  • Listbox Header
    Have a named range called "AccidentsHeader" Within my code I have: [CODE]Private Sub CommandButton1_Click() ListBox1.RowSource =...
  • Complex Heat Map using conditional formatting
    Good day excel world. I have a concern. Below link have a list of countries that carries each country unique data. [URL...
  • Conditional formatting
    Hi good morning, hope you can help me please, I have cells P4:P54 and if this cell is equal to 1 then i want row O to say "Fully Utilised" and to...
Top