if-statementgoogle-sheetstextjoincolumnheaderrowheader

How to return Row and Column header of a data in table


I am trying to find a function where I can return Row and Column Headers of a data from a table. I have attached a screenshot of a sample data table.

enter image description here

And below is the result I am working out.

enter image description here

Here's a link of the sample sheet.

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

Any assistance is greatly appreciated.

Thank you

I tried researching the internet and here as well. I have encountered index-query formula, but I haven't really been understanding it well. I have tried the common lookup functions.


Solution

  • try:

    =INDEX(SPLIT(TOCOL(B3:F7&"×"&A3:A7&"×"&B1:F1&"×"&B2:F2), "×"))
    

    enter image description here

    with open ranges:

    =INDEX(SPLIT(TOCOL(FILTER(B3:F, A3:A<>"")&"×"&TOCOL(A3:A, 1)&"×"&B1:F1&"×"&B2:F2), "×"))