TransWikia.com

How to reproduce cells that are in the same row a certain time?

Stack Overflow Asked by Snm on January 19, 2021

How to reproduce cells that are in the same row a certain time? Please see the screenshot.

screenshot

3 Answers

I thought a bit and figured out a simple solution as shown in the screenshot.please see the formula here

Answered by Snm on January 19, 2021

If you have Excel O365 with dynamic arrays and the SEQUENCE function, you can use these formulas in a single cell.

The results will SPILL over the requisite number of Cells, and adjust if you change the data ranges.

I used Dynamic named ranges for the two rows of information you have, but you could use Tables, or other methods:

A7:  =INDEX(myMonths,1,INT(SEQUENCE(,COLUMNS(myData)*COLUMNS(myMonths),1,1/COLUMNS(myData))))
A8: =INDEX(myData,1,MOD(-1+SEQUENCE(,COLUMNS(myData)*COLUMNS(myMonths)),COLUMNS(myData))+1)

enter image description here

Answered by Ron Rosenfeld on January 19, 2021

Use INDEX function to reference each of your text ranges as a 1D range.

Then you just need to develop two counters. The first counter will increase by 1 every 4 columns, the other will reset/loop every 4 columns. Use these counter to pull the appropriate cell address from the INDEX Function.

The following formula increases by 1 every 4 columns:

=INT((COLUMN(A:A)-1)/4)+1

The following formula loops a count of 1 to 4 as its copied to the right:

=MOD(COLUMN(A:A)-1,4)+1

Combined with with an index you can use the following formulas:

Names
=INDEX($A$1:$G$1,INT((COLUMN(A:A)-1)/4)+1)

Letters
=INDEX($A$3:$D$3,MOD(COLUMN(A:A)-1,4)+1)

POC

Note the formula will produce an error if you pull it too far to the right as it will run out of names in the index to reference. It will work for a maximum columns Number of Names X Number of Letters, or the Maximum number of columns in your spreadsheet, which ever is smaller.

Answered by Forward Ed on January 19, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP