5

Basically, the problem is summarized by the picture below.

enter image description here

https://i.stack.imgur.com/H8YzR.jpg

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,

user3788581
  • 97
  • 1
  • 6
  • The logic here is if the (base 1) horizontalcell index is greater than or equal to the start number and less than the start number plus the length, then show the descriptor, else blank. Should be able to put this in an excel formula. – bryan60 Jul 08 '19 at 03:55

2 Answers2

4

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,"")
bryan60
  • 28,215
  • 4
  • 48
  • 65
2

@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

JvdV
  • 70,606
  • 8
  • 39
  • 70