google-sheetsindexingmatch

Looking to return a row cell (date) from an INDEX look up of 2nd last entry in a ROW


Title probably not a good description but can anyone help please?

I have rows of players with columns of dates they could possibly have scored a goal in. Column A returns the number of goals scored the last time they did but I am looking to match that entry with the date they last scored on either in in Column B

Sample sheet link below. Looking for Column B to be automated to return the entry manually entered in B3,4 examples.

https://docs.google.com/spreadsheets/d/1yYJf3iQU43uWc2cEjJhVm1TQ1NB_VbYrETgLX6ka1H4/edit?usp=sharing

Thanks in advance, possibly a simple solution, but I cannot see it.


Solution

  • You may try:

    =byrow(E3:U,lambda(Σ,if(counta(Σ)=0,,choosecols(filter(E2:U2,Σ<>""),-1))))
    

    enter image description here


    If the dates are ever-expanding & the formula needs to pick 2nd last entry(skip the Grand Total value)

    =byrow(indirect("E3:"&rows(A:A)),lambda(Σ,if(counta(Σ)=0,,choosecols(filter(E2:2,Σ<>""),-2))))
    

    enter image description here