In this video, we want a formula that will create raffle ticket categories that we can copy down, and it gives us the correct categories. We first need to know the increment between the lower and upper limit. The person who asks this question says the increment should be 6, and that there has to be enough categories so the final upper end is 1500.
Anytime you have a formula that's incrementing numbers as you copy the formula down, the trick is to use the ROWS function. As I copy down, I need the formula to give me, as a starting point, 1, 2, 3, 4, and so on. I use a dollar sign to lock the row reference to A, then use ROWS($A$1:A1). This is an expandable range. The second A moves to A2, A3, A4, and so on as we copy down. ROWS will always count how many rows there are, so ROWS($A$1:A1) is 1, ROWS($A$1:A2) is 2, ROWS($A$1:A3) is 3, and the next cell will be 4, and so on. I use Control+Enter to copy it down.
Now, what you do not want to do, and what is often done, is use the ROW function with cell A1. When I copy this down, it gives us the same thing, but anytime you change the structure of your spreadsheet, like inserting a row, that formula fails. That's why we use ROWS. Similarly, if you're copying to the side, you use COLUMNS. By the way, we can see the expandable range with the relative reference changing as we copy down.
Now, anytime you're incrementing and you want to jump by a certain amount, we're first going to try multiplying by 6, because 1 times 6 is 6, 2 times 6 is 12, and so on. I use F4 to lock the reference, Control+Enter, double-click, and send it down. Now, we actually need to start at 1. So in the formula, we take the ROWS portion, put it in parentheses, and remember that gives us 1, 2, 3. We simply subtract 1, so in the first row we get 0. I edited the formula with all the remaining formulas highlighted, so to populate this through the highlighted range, I use Control+Enter. We almost have our starting position. Next, we simply add one, Control+Enter, and there's our starting position.
Now we need a dash, then a 6, then a 12. I'm going to cheat by copying the existing text. At the end, I add an ampersand and, in double quotes, a dash, and then another ampersand, and now we paste that multiplied by whatever the increment is. If I press Control+Enter to populate that through, we get what we want.
I want to show you a fun trick here. We could easily just copy this down and drag until we see 1500, but I'm curious how many rows there are. Whatever the upper limit is, divided by this 6, it looks like we need to go down to cell not A250 but A251. So I select the cell, click in the Name Box, and type A251. Before I hit Enter to use the Go To feature to jump down there, I hold Shift, and then press Enter. Now the very top cell has our formula. To populate it all the way down through the highlighted range, we can't use Control+Enter like we did earlier because it's not in edit mode, but I can use Control+D. And there you go. Control+Home.
That's an interesting number-incrementing formula. There are many other types of formulas that increment numbers in different ways. To see a video that shows you some other possibilities, check out the video about incrementing numbers. Also watch the next Excel Magic Trick for how to do this with dynamic arrays.
