Search code examples
google-sheetsgoogle-sheets-formula

Shift or move results of QUERY function by (n) cells to the right in google sheets


I'm trying to return and offset by (n) months the results of a query function that outlines a revenue cadence in months. I know I can return the values in the range that outline the revenue cadence into the same cell, but I need to be able to move this schedule along a timeline based upon the number of months at which the revenue starts coming in.

I've tried utilizing offset, and including blank values into the start of the query, but that only works by manually adding in the bank spaces, which defeats the purpose.

Does anyone know of a way to do this? Would absolutely consider any method (whether it uses Query or not).

Example sheet is here: https://docs.google.com/spreadsheets/d/12xw0Q3jTVcRYa3xeKqkDz36Kt7xD32nwstpICl8_28o/edit#gid=0

Example sheet here. The revenue cadence per tier is in D5:AB9, and I'm looking to return the values into the cells based that begin in E14 based upon the number of months offset specified in column D.


Solution

  • Thanks for the answer - but that didn't work for me. I used this approach instead:

    =if(G$16>=$C17,index($B$4:$BC$12,match($B17,$B$4:$B$12,0),1+ifs(G$16=$C17,1,G$16<$C17,"",G$16>$C17,1+DATEDIF($C17,G$16,"m"))),"-")