Excel formula

I am looking for a excel formula to create the below if possible...

The row number to increase by 1 every 4 rows. So it would be like the below...

1
1
1
2
2
2
3
3
3
4
4
4

How would I do this?
petewinterAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Bill PrewIT / Software Engineering ConsultantCommented:
Assuming you wanted to start at row 1, then this would work.  I'm sure there are many other ways to accomplish this also.

=TRUNC((ROW()-1)/3)+1

~bp

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
petewinterAuthor Commented:
Many thanks, but how do I start at a particular number instead of 1?
SteveCost AccountantCommented:
You can also use INT:

=INT((ROW()-1)/3)+1

Change the +1 at the end to start from a diferent number (in both formulas)
CompTIA Network+

Prepare for the CompTIA Network+ exam by learning how to troubleshoot, configure, and manage both wired and wireless networks.

Bill PrewIT / Software Engineering ConsultantCommented:
Many thanks, but how do I start at a particular number instead of 1?
Just change the "1" at the end of the formula.

~bp
petewinterAuthor Commented:
Many thanks
Bill PrewIT / Software Engineering ConsultantCommented:
Welcome, glad that was useful.

~bp
Rob HensonFinance AnalystCommented:
Assuming you are entering the first number in the first row required, use this formula in rows below it:

=IF(COUNTIF(M$1:M1,M1)>=3,M1+1,M1)

This assumes starting at M1 but can start on any row with manual entry in first cell. Adjust the number in bold for the number of rows required.

Thanks
Rob H
Saqib Husain, SyedEngineerCommented:
Although the question is closed, I would have used this approach:

Enter the three ones in A1, A2, A3.
In A4 enter the formula =A1+1
And copy this formula down.
Subodh Tiwari (Neeraj)Excel & VBA ExpertCommented:
More robust approach would be like this....

=INT((ROWS(A$1:A1)-1)/3)+1

This way you can place your formula in any desired cell and copy it down.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Excel

From novice to tech pro — start learning today.