I have a spreadsheet from which I need to select ONLY the first five rows in each category.

I only want columns `A`

and `B`

when `C`

is less than 5 -- `=IF($C1>5,$A1,)`

and `=IF($C1>5,$B1,)`

-- but I would like to exclude blank rows when `$Cn`

is greater than 4.

In a perfect world, there would be a function that I could append as the "fail" condition, giving me this: `=IF($C1>5,$A1,[insert next instance of $An where $C1<5])

Any ideas on making this simple?