HomeGoogle DocsSpreadsheetShift Column in a Filter Formula When Dragging Down – Google Sheets

Shift Column in a Filter Formula When Dragging Down – Google Sheets

Usually, in Google Sheets, when we use a FILTER formula with an absolute range for the data (like $A$2:$A$10) and a relative reference for the criteria (like B2:B10), the criteria column updates correctly when dragging across columns, but the column stays the same when dragging down.

This means that as you copy the formula down, it continues to reference the same criteria column instead of moving to the next one. Let’s see how to fix this with a simple example.

Example Data

I have a small student marks table with the following columns:

  • Student Name
  • Maths
  • Chemistry
  • Physics
  • General Knowledge

Now, I want to filter out the poor performers (those who scored less than 20 out of 50) for each subject.

  • First row → poor performers in Maths
  • Next row → poor performers in Chemistry
  • Next → Physics
  • and so on.

Step 1 – Normal Filter Formula

For Maths, the basic formula is:

=IFNA(FILTER($A$2:$A$10, B2:B10<20, B2:B10<>""))
Google Sheets showing FILTER formula for students scoring below 20 in Maths

This works fine. If I copy-paste to the right, it picks Chemistry, Physics, etc. But if I drag down, it stays stuck on the Maths column.

⚠️ Also, if the FILTER returns multiple values, dragging the formula down can cause a #REF! error.

Step 2 – Use TRANSPOSE

Next, I want the results to show in one row, so I wrap the formula with TRANSPOSE:

=TRANSPOSE(IFNA(FILTER($A$2:$A$10, B2:B10<20, B2:B10<>"")))
Google Sheets using TRANSPOSE with FILTER formula to display poor performers horizontally

This just changes the layout, but the column reference still doesn’t shift when dragging down. However, using TRANSPOSE also solves the #REF! error that can occur when FILTER returns multiple values.

Step 3 – Shift the Column When Dragging Down

Here comes the trick. Instead of locking B2:B10, I use INDEX to dynamically point to the correct subject column:

=TRANSPOSE(
  IFNA(
    FILTER(
      $A$2:$A$10,
      INDEX($B$2:$E$10, 0, ROW(A1))<20,
      INDEX($B$2:$E$10, 0, ROW(A1))<>""
    )
  )
)
Google Sheets shifting FILTER formula columns down using INDEX function

How it works:

  • ROW(A1) returns 1 in the first row, 2 in the next, etc.
  • INDEX then uses that number to pick the subject column (Maths = 1, Chemistry = 2, etc.).
  • That way, as you drag the formula down, the criteria column shifts automatically.

Step 4 – Automate with BYCOL (Optional)

If you don’t want to drag formulas at all, you can use the BYCOL function:

=TRANSPOSE(
  BYCOL(
    B2:E10,
    LAMBDA(col, IFNA(FILTER(A2:A10, col<20, col<>"")))
  )
)

This applies the same filter logic to each subject column automatically. The TRANSPOSE just makes the results easier to read row by row.

Why This Matters

Shifting the column in a Filter formula when dragging down is handy when:

  • You need to analyze multiple subjects or categories row by row.
  • You don’t want to keep rewriting or manually editing formulas.
  • You want a neat layout where each row represents one subject’s filtered results.
Prashanth K V
Prashanth K V
Your Trusted Google Sheets and Excel Expert Prashanth K V is a Diamond Product Expert in Google Sheets, officially recognized by Google for his contributions to the Docs Editors Help Community and featured in the Google Product Experts Directory. Explore his blog to learn advanced formulas, automation tips, and problem-solving techniques to elevate your spreadsheet skills.

Top Discussions

More like this

How to Build a Dynamic Nonogram Clue Generator in Google Sheets

Over the past few months, I've built a couple of games in Google Sheets,...

Carpool Cost Splitter & Rotation Tracker in Google Sheets (Free Template)

Managing a carpool can be difficult, especially when you need to track whose vehicle...

How to Build a Road Trip Fuel Cost Splitter Formula in Google Sheets

Need a fair formula to split fuel costs among travelers on a long road...

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.