Hide empty rows without using VBA (offset)

japers

New Member
Joined
Dec 8, 2010
Messages
18
I thought this would be easy but I have been pulling my hair out over this one! I basically have a row of items (variable number of items) which show either a value or nothing (cell="") depending on requirements. As an example, imagine 15 rows A-O with a few blanks as per below:

A
B

D
E
F



J
K


N
O

Now what I would like is to have another column parse through these and remove the empty lines so that it would look like this. Because these are live cells which depend on others and have dependents, I cannot use a VBA sort/copy/paste values macro. I would ideally like to use formulas which would also update this "live". I have been trying to achieve this using offset (and quite a few hidden rows) but just cannot get my offset number to work reliably and for it to show the above like this:

Vert. Offset required to the right for info
A 0
B 0
D 1
E 1
F 1
J 4
K 4
N 6
O 6

Can anyone manage to make this work? The problem is being able to calculate the correct offset if there is more than 1-2 blank rows - in practice maybe all rows bar the last may be empty!
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
Sorry I think my title might have been a little misleading - I don't want to hide rows in the technical sense.

I just cannot work out a formula that would calculate the correct offset so that another column/sheet shows only the relevant non-blank rows from this source column.

Any ideas?
 
Upvote 0
One way would be to use helper columns.

C1 is blank or houses a 0.
C2 & E2 copied down.

Excel Workbook
ABCDE
19
2A1A
3B2B
42D
5D3E
6E4F
7F5J
85K
95N
105O
11J6
12K7
137
147
15N8
16O9
17
Compact List
 
Upvote 0
Peter,

Thank you so much! Having seen the solution, I can safely say that even if I spent a 8 hours a day for a month on this, I still wouldn't have got it!!!! The closest I got was using one helper column per row - not very efficient!

Thanks again!

jp
 
Upvote 0

Forum statistics

Threads
1,224,566
Messages
6,179,558
Members
452,928
Latest member
101blockchains

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