Search code examples
excelexcel-formuladraggable

Find last value before blank relative to cell


I have a data-set with a large number of smaller tables arranged in two columns.

To do some calculations, in each row i need to find the total for the smaller table that row belongs to, below is a picture to illustrate.

enter image description here

Is there a formula I can use that can be dragged to populate every row in the data-set? there are hundreds of tables in each column so having to manually set the total cell for each row/section would take hours.


Solution

  • Try this in H3 then fill down.

    =IF(B3<>"", INDEX(C3:C$9999, MATCH("total", B3:B$9999, 0)), "")