FILTER formula that will hide blank rows.

lite4d

Board Regular
Joined
Jan 25, 2010
Messages
50
I have a spreadsheet that I want to filter data based on dates and the data will range from 3 rows to 120 rows based on the dates that are chosen. What I need to do is add something in the formula to shrink the rows to just the ones with data and expand with the data as required. My current formula is below:

=FILTER('Random Receipts'!A2:Q120,('Random Receipts'!K2:K120>=C3)*('Random Receipts'!K2:K120<=D3))

Right now I have to have 120 rows to cover for the data that "could" be there. I want it to shrink and grow as required. What do I need to add to my formula to get that to work?

I have tried a few things but nothing is working correctly. I just get the $spill error.

Thanks for the help as always!!
 
I still do not understand what blank rows below it you mean? The rows from 21 onwards?
Do you get a spill because you have data in rows 135? and you formula returns more than 120 rows?
 
Upvote 0

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
I still do not understand what blank rows below it you mean? The rows from 21 onwards?
Do you get a spill because you have data in rows 135? and you formula returns more than 120 rows?
When I select dates in C3 and D3, it filters the data that I see in B15:R15 and gives me the ones that meet that criteria below it. If its 3,6,9 rows. The way it shows now is that I have 3 rows of data and 117 empty rows below it that I would like to not see. If I have 2 days then I would see 6 rows of data and 114 empty rows below it. I would only like to see the rows that have data and not the rows below it. If my data pulls 35 rows then I want to just see those 35 rows. Is there a way to hide those empty ones below?
 
Upvote 0
Is there a way to hide those empty ones below?
As we have both said, that formula (if entered correctly) will not return blank rows.
Can you please answer my question in post#20
 
Upvote 0
Is there something at the bottom that you WANT to see? "Stacked" (so to speak) below your result from the filter function?

Like a footer to your table?
 
Upvote 0
In that case I need to see your data & how your applying the formula, as there is no way that formula should return blank cells.
 
Upvote 0
Do you want something like this?

Book1
ABCDEFGHIJKLMNOPQ
32024-01-012024-01-01
11
12Header 1Header 2Header 3Header 4Header 5Header 6Header 7Header 8Header 9Header 10Header 11Header 12Header 13Header 14Header 15Header 16Header 17
13[^S\IJVTFYQLD]OPI^NEBGI\WIHJTSHKQJZ]O[MI45292EQQSPTI^N\BLPCECFRDJBM][
14Footer 1Footer 2Footer 3Footer 4Footer 5Footer 6Footer 7Footer 8Footer 9Footer 10Footer 11Footer 12Footer 13Footer 14Footer 15Footer 16Footer 17
Sheet1
Cell Formulas
RangeFormula
A13:Q14A13=VSTACK(FILTER('Random Receipts'!A2:Q120,('Random Receipts'!K2:K120>=C3)*('Random Receipts'!K2:K120<=D3)),{"Footer 1","Footer 2","Footer 3","Footer 4","Footer 5","Footer 6","Footer 7","Footer 8","Footer 9","Footer 10","Footer 11","Footer 12","Footer 13","Footer 14","Footer 15","Footer 16","Footer 17"})
Dynamic array formulas.


Book1
ABCDEFGHIJKLMNOPQ
32024-01-012024-01-02
11
12Header 1Header 2Header 3Header 4Header 5Header 6Header 7Header 8Header 9Header 10Header 11Header 12Header 13Header 14Header 15Header 16Header 17
13[^S\IJVTFYQLD]OPI^NEBGI\WIHJTSHKQJZ]O[MI45292EQQSPTI^N\BLPCECFRDJBM][
14HAECVFEDX^VLMHWTJENYANPMEHXH^GHWTCN]CG[P45293[SB]DZ^BSV[SUXBMJZ[LXXOG
15XWYIXCG[ZMWKPQJSHDC]FVDJUSIMAH]\IWQIOC]K45293[AUN[GATS\IISZQFAOY[TKEG
16ASIRRBUWXX[]BC\INQBV]XZ[V]REU^N^[LVKVRMA45293JCGR]I^YFUEV^^DMIOCJDUQZ
17UHMUTYMZHOIYGIMCPRHAHLIMQZMJKMZYFWU][KHS45293^JCVSJ\KQXPFPZEUNPINUSQG
18Footer 1Footer 2Footer 3Footer 4Footer 5Footer 6Footer 7Footer 8Footer 9Footer 10Footer 11Footer 12Footer 13Footer 14Footer 15Footer 16Footer 17
Sheet1
Cell Formulas
RangeFormula
A13:Q18A13=VSTACK(FILTER('Random Receipts'!A2:Q120,('Random Receipts'!K2:K120>=C3)*('Random Receipts'!K2:K120<=D3)),{"Footer 1","Footer 2","Footer 3","Footer 4","Footer 5","Footer 6","Footer 7","Footer 8","Footer 9","Footer 10","Footer 11","Footer 12","Footer 13","Footer 14","Footer 15","Footer 16","Footer 17"})
Dynamic array formulas.


So that the footer continues after the data pulled from "Random Receipts"?
 
Upvote 0
Is there something at the bottom that you WANT to see? "Stacked" (so to speak) below your result from the filter function?

Like a footer to your table?
Here is the bottom of the page. This shows the bottom of the empty rows that I don't want to see. Down to row 134. So I only want to see the data rows and have it shrink from row 135 to the bottom of the rows of data that I have whether its 3 10 or 20 rows. I'm not sure if that makes sense or not. It might not even be possible.

2024-01-10_13-12-37.jpg
 
Upvote 0
Why didn't you say that.
And the answer is no. This is not possible with a formula (that I know of).
You will have to hide the rows. Only way I can think of is VBA.
 
Upvote 0
Are you saying that the spill range shows exactly what you want, rather than what you want plus empty rows inside the spill?
 
Upvote 0

Forum statistics

Threads
1,223,248
Messages
6,171,021
Members
452,374
Latest member
keccles

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top