Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to have cells dynamically populate based on start and length

Basically, the problem is summarized by the picture below.

enter image description here

https://imgur.com/a/vBU2xMK

The "Start" column is when the beginning of "Descriptor" variable starts and it populates the number of rows starting according to the value in the "Length" column that starts from the "Start" column.

Solving this using values is simple on a small dataset such as the example but how would it be replicated using formula?

Thanks,

like image 429
user3788581 Avatar asked Jul 08 '19 03:07

user3788581


People also ask

How do I auto populate data in Excel based on another cell?

Anyone who has used Excel for some time knows how to use the autofill feature to autofill an Excel cell based on another. You simply click and hold your mouse in the lower right corner of the cell, and drag it down to apply the formula in that cell to every cell beneath it (similar to copying formulas in Excel).

What is a dynamic cell in Excel?

Dynamic Formulas allow you to insert Excel's formulas into cells even when the formula must reference rows that will be inserted later during the merge process. They can repeat for each inserted row or use only the cell where the field is placed.


Video Answer


2 Answers

Something like this in cell D2, then drag as needed.

=IF(AND(COLUMN()-3>=$A2,COLUMN()-3<$A2+$B2),$C2,"")

just noticed the numbers up top, so this is also workable:

=IF(AND(D$1>=$A2,D$1<$A2+$B2),$C2,"")
like image 59
bryan60 Avatar answered Oct 06 '22 22:10

bryan60


@Bryan60 his answer is nice and clear!

For the sake of alternatives, in cellD2:

=IF(D$1=MEDIAN(D$1,$A2,$A2+($B2-1)),$C2,"")

Or when the numbers on the top are not there:

=IF(COLUMN(A1)=MEDIAN(COLUMN(A1),$A2,$A2+($B2-1)),$C2,"")

Drag down and right.

enter image description here

like image 2
JvdV Avatar answered Oct 06 '22 23:10

JvdV