Search code examples
google-sheets

Grabbing the nearest uppermost-parallel value of another column under X conditions


Objective: Write an array formula inside a column that outputs the nearest uppermost-parallel value from other column under the condition that a different column is set to a specific value.

See sheet and image below for example inputs and outputs. If the image fails to open, it is also inside the Sheet in "Image" tab.

Image


Solution

  • You may try:

    ={"formula_";index(if((B5:B="Parent")+(B5:B=""),,scan(,A5:A,lambda(a,c,if(c="",a,c)))))}
    

    enter image description here