Home > OS >  Best formula to display data from last X number of columns in a row?
Best formula to display data from last X number of columns in a row?

Time:09-08

I need to display the last X number of cells containing data from the columns on my Data sheet in a row on my Horizontal sheet. In enter image description here

and:

=OFFSET(A1,,COUNTA(1:1)-10,,10)

enter image description here

CodePudding user response:

You can transpose the data within the query in order to get a vertical list of the last 10 values, like this:

=QUERY(TRANSPOSE(Data!B1:1),"limit 10 offset "&(COUNT(Data!B1:1)-10))

If you need it horizontally, transpose the whole formula again to retain the horizontal orientation.

=TRANSPOSE(QUERY(TRANSPOSE(Data!B1:1),"limit 10 offset "&(COUNT(Data!B1:1)-10)))
  • Related