sequence of numbers

  • Thread starter Thread starter andrewm
  • Start date Start date
A

andrewm

how do I do a formula to automatically put numbers in a cell

if a1 = 1

I would like a2, a3, a4, a5, a6..... to be 2,3,4,1,2,3,4.....

how do I make the sequence change from 4 back to 1

ie. a1 maybe 3

thus a2,a3,a4,a5,6......would be 4,1,2,3,4,12.......

what would the formulas be in the cells


andrewm
 
andrewm said:
how do I do a formula to automatically put numbers in a cell

if a1 = 1

I would like a2, a3, a4, a5, a6..... to be 2,3,4,1,2,3,4.....

how do I make the sequence change from 4 back to 1

ie. a1 maybe 3

thus a2,a3,a4,a5,6......would be 4,1,2,3,4,12.......

what would the formulas be in the cells


andrewm

Hi Andrew

In B1 put this formula =IF(A1<4,A1+1,A1-3) and drag across as far a
require
 
Same result with different approach:

In A2 type: =IF(MOD(A1+1,4)=0,4,MOD(A1+1,4))

and drag copy down as far as necessary
 
In A2 type: =IF(MOD(A1+1,4)=0,4,MOD(A1+1,4))

I think this may be equivalent:
=MOD(A1,4)+1

However, another option might be:
A1: =MOD(ROW()-1,4)+1

...and copy down
HTH
 
Back
Top