Forum Discussion
Non-Consecutive Cell Referencing
Hi, folks.
I'm attempting to create a spreadsheet that contains links from consecutive cells to consecutive cells in another worksheet that are separated by 5 intervening cells.
I'll call the original consecutive spreadsheet "Orig" (for original).
So, I know that if I put "='Orig'!A3" in cell B3 and then copy that down, it will update the relative formula consecutively, i.e. B3='Orig'!A3, B4='Orig'!A4, B5='Orig'!A5, B6='Orig'!A6.... that much I get.
What I need to do is find a way to do the same thing, but to increase the resulting link.....so that if I copied the formula down column B I would get: B3='Orig'!A3, B8=Orig'!A4, B13='Orig'!A6', etc so that the new worksheet is moving down 5 cells relative to the Orig sheet consecutive order.
I've read where someone used a formula using the INDIRECT function but that's beyond my beginner level.
Many thanks, and merry Xmas to all!
Thank you also for your help. I will stick to your proposal for the reasons you give. But I will play around with all suggestions just to get an idea of how and why these functions work. Have a Merry Xmas!
17 Replies
- PeterBartholomew1Silver Contributor
May I be a bit harsh. In my opinion you are beginning your adventure of learning Excel by focussing upon obsolete techniques, maybe forced upon you by the use of legacy software. In these days of dynamic arrays, the concept of relative referencing an dragging formulas down is over-complicated and confusing!
If you wish to reference every 5th element of an 'array', one way of doing it is to wrap the array across 5 cells at a time.
wrapped = WRAPROWS(array, 5)You will see the references you require in the first column. To select the column one simply chooses it
every5th = CHOOSECOLS(wrapped, 1)These are most useful in situations in which the other columns are used in separate calculations. If they are not used, INDEX will work
= INDEX(array, SEQUENCE(n,,, 5))Putting these together, either by nesting or by using the LET function to define variables
every5th = CHOOSECOLS(WRAPROWS(array, 5),1) or (a bit more advanced) every5th = LET( wrapped, WRAPROWS(array, 5), CHOOSECOLS(wrapped, 1) ) every5th = LET( k, SEQUENCE(n,,,5)), INDEX(array, k) )I am not trying to get at you. It is simple that I believe that you should be encouraged to start your journey by travelling forwards, not back to the past.
Maybe the other expert contributors to this discussion have a different opinion.
- MattKW1Copper Contributor
Thank you for your suggestion. Other forum members have asked why I would want to do such a strange manipulation. I have just replied to mathetes so that should be up soon.
I use Excel mostly as a quasi-database for text. I also like the easy way of sorting columns (alphabetically, numerically), so up until now, I could manage the easy formulae myself.
I am 67 yo, and was brought up when my school had a "computer" that could hold 99 steps from punch-out data cards! Then I learned BASIC and used that for my dental staff wages on a programmable Casio calculator in the early 80s before I transferred that process into Excel on a real PC. So I don't need to keep up with the evolving Excel techniques, most of which are of no use to me.
I am very thankful to all of the contributors who have put effort into my abstruse problem.
- johnmillarCopper Contributor
You can do this with a simple formula, no INDIRECT needed.
In B3, use:
='Orig'!A3
In B8, use:
='Orig'!A4
The trick is to automate that pattern. Put this formula in B3 and copy it down:
='Orig'!A3+INT((ROW()-ROW($B$3))/5)
This makes the source cell move down by 1 in Orig every 5 rows in column B.
Simple, clean, and beginner-friendly.
- m_tarlerBronze Contributor
maybe i'm missing something but
='Orig'!A3+INT((ROW()-ROW($B$3))/5)
will just ADD numbers to the VALUE in A3 and if you intended to copy that to every 5th cell then A3 would change also so you may have meant to use $A$3 (or at least A$3) but either way don't see that working
sry
- mathetesGold Contributor
Nobody has yet asked a question that I wanted to ask from the start: Why?
You don't have to answer, of course; may even view it as an impertinent question: what business is it of mine to question your question?!
But I am curious. It's an unusual request, and seems like a strange task. In general I'm a person who likes to keep rows and columns filled, not have blank rows or columns between sets of data, yet here you're going to lengths to create blank rows! So you've piqued my curiosity.
Are you willing to share the purpose? How you'll be filling or using those newly created blank rows?
- MattKW1Copper Contributor
Of course.
I have students under my clinical supervision at a university dental school. The 2025 patients have unfinished treatment and I have worked my way through 90 patients that will be returning, and making notes for the incoming class of 2026.Rather than present the info as 1 row at a time (ID, Last_Name, First_Name, Title, Last_Treatment, ..., it would be more efficient to compile it into something I can print onto a perforated A4 sheet (3 per sheet) so they can tear off each patient and get going. It will create much less confusion, and the patients won't have their time wasted.
So, it's not an Excel numerical problem, but just a text rearrangement, hence the spaces. It would not have been feasible in Word, because the Orig sheet has many other columns as I tracked the patients over 2025.
- mathetesGold Contributor
OK. So basically, at least as far as this particular request is concerned, you're using Excel solely for its rows and columns, as a way to display text info in a nicely formatted or arrayed fashion. You're NOT using it for any calculations or database summarizations where something like Pivot Table might be useful.
Thanks for explaining it. Normally I would have considered something like this an abuse of Excel, but you've clearly chosen it over Word in this instance because you are integrating it with an associated sheet where you legitimately use Excel for tracking purposes.
- m_tarlerBronze Contributor
as always, you have good questions and if they told us why the gaps or what will go in the gaps we might create a single array function to fill the whole column. But I'm assuming the intend to fill those gaps with something and hence why I specifically didn't use an array function to fill the whole column
- IlirUBrass Contributor
I think you can use the following formula which is a dynamic formula and does not use the INDIRECT function which is a volatile function.
=IFERROR(TOCOL(EXPAND(Orig!A3:A10,, 5)), "")or this formula:
=SCAN("", IFERROR(TOCOL(EXPAND(Orig!A3:A10,, 5)), ""), LAMBDA(a,b, IF(b = "", a, b)))The first formula leaves 4 empty cells after each cell with data, while the second formula fills the empty cells.
Change the range in the formula according to your need.
Hope this helps.
IlirU
- LorenzoSilver Contributor
MattKW1
Option from m_tarler is much better - from an efficiency perspective as well. If you want to stick to INDIRECT the following addresses his point re. locked column A on the Orig sheet, the sheet name remains locked though *:=INDIRECT( ADDRESS( QUOTIENT( ROW(B3)-ROW(B$3) +1, 5 ) +ROW(Orig!A$3), COLUMN(Orig!A3),,, "Orig" ) )* A workaround exists with Excel >/= 2013
- MattKW1Copper Contributor
Thank you very much for your reply. No, I wasn't hung up on INDIRECT and still don't quite understand it, but I had seen it suggested elsewhere in a similar case.
- m_tarlerBronze Contributor
You do NOT need to use INDIRECT for this and recommend against using INDIRECT.
If you are OK with or prefer copy down (as opposed to an array formula that will spill (especially if you plan to 'fill' in the rows inbetween, then:
a) B3 = INDEX('Orig'!A:A,(ROW()-ROW($B$3))/5+ROW('Orig'!$A$3))
b) highlight cells B3:B7 then either drag the fill down dot (the dot in lower right corner of highlighted section) or copy and then highlight area to paste in and paste
so why don't use INDIRECT and use the INDEX above instead and why use ROW($B$3) instead of just typing 3? Basically it makes it more robust in case you insert or delete lines or move things around excel will shift those cell references accordingly. For example you decide to add a header to the sheet and insert 3 rows above row 1 then the formula would automatically shift to be in cell B6 and those references would also reference $B$6
EDIT: BTW, Lorenzo also did similar in their second option. The only difference in this case is using INDIRECT 'locks' in the sheet name and column as "Orig!A" but using INDEX above (or there are other options like OFFSET you could use instead) then if you change the sheetname or insert a column to the left of the existing column A it will shift/change name accordingly.
- MattKW1Copper Contributor
Thank you also for your help. I will stick to your proposal for the reasons you give. But I will play around with all suggestions just to get an idea of how and why these functions work. Have a Merry Xmas!
- mathetesGold Contributor
MattKW1 wrote: I've read where someone used a formula using the INDIRECT function but that's beyond my beginner level.
To which I respond, don't sell yourself short. The only way any of us learn without taking courses (and maybe even then)--expecially in Excel--is by playing around with those things we don't yet know. "Playing around" sometimes goes by the term "trial and error." INDIRECT definitely is one of those functions, one of many, where it often takes a bit of trial and error to get it right, but it's truly far better to go through that than to just have the answer handed to you.
May I recommend for future times when you are feeling like you're in over your head that you acquaint yourself with ExcelJet, where there are really helpful descriptions, along with examples, of functions like INDIRECT. I've learned a lot there myself, over recent years, by adding what's shown there with a little bit of playing around myself.
You're not going to break anything by trial and error (I do recommend that you save a backup copy of your workbook first, especially if it's at, you know, work.)
- MattKW1Copper Contributor
Thank you for the inspiration. I sincerely appreciate all of you who have contributed answers, and I'll try to learn from them. By and large, I don't need to do more than beginner Excel, so it's great to come to fora like this where people are so willing to help when I am out of my comfort zone.
- LorenzoSilver Contributor
Hi
On your other sheet in B3:
=INDIRECT( "Orig!A" & QUOTIENT( ROW(B3), 5 ) +3 )EDIT: OR - safer:
=INDIRECT( "Orig!A" & QUOTIENT( ROW(B3)-ROW(B$3) +1, 5 ) +ROW(Orig!A$3) )Merry Christmas 2