Combining non-contiguous ranges

twintrbl23

New Member
Joined
Mar 12, 2007
Messages
29
Apologies in advance if my description is vague. I'm not even sure how to describe what I'm trying to do. I have a range on a worksheet that will be used for data entry. There are a potential of 200 rows in this range. I need to repeat what was entered in this range on another tab, but without including any potential blank rows. In a super simplified scenario:


Excel 2010
ABCDE
2SOURCERESULTORALTERNATE RESULT
3ApplesApplesA5
4CarrotsCarrotsA6
5BananasBananasA7
6PineappleA9
7PineappleGrapesA10
8GrapesCherriesA13
9OrangesA14
10PearsA15
11CherriesLemonsA16
12Oranges
13Pears
14Lemons
Sheet2



As you can see, the Source column has some blank rows, and in the RESULT range, I need to remove the blanks. If it were really this small a range, I might put in Column C a formula that says "=IF(A1<>"",A1,IF(A2<>"",A2,IF(A3<>""......." and so on. But with 200 rows, that's not viable.

I tried using MATCH to find the next non-blank row and using that as an offset to the formula, but when you have two blank rows, it doesn't pick up on the fact that I'm not looking for the first non-blank anymore (since I caught that in the row above), and trying to find the second non-blank after that... well, I get into another endless nested formula again.

I tried playing with some array formulas, but they just copied the blanks too. The third column for an alternate result would work too, as I'd use that as the source for an INDIRECT formula.

Unfortunately, I need to avoid VBA code, if possible. The end users won't be manually copy and pasting, nor will they want to run macros. So I'm hunting for a super formula (or set of nested formulas) that can duplicate that huge data entry range without the blanks. I know in a pinch, I can set up the RESULT area as a filtered table, then use an auto filter to hide the non-blank rows, but that would also require a macro to run.

Any suggestions?
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
Try this array formula in C3 copied down (Excel 2007 or higher)

=IFERROR(INDEX($A:$A,SMALL(IF($A$3:$A$300<>"",ROW($A$3:$A$300)),ROWS(C$3:C3))),"")

Hope this helps

M.
 
Upvote 0
It works!!! Thank you!!! Now I'm going to have to go hunting to figure out why that works (just because I'm a nerd and want to know everything :) ), but YAY!!! Thank you!
 
Upvote 0
It works!!! Thank you!!! Now I'm going to have to go hunting to figure out why that works (just because I'm a nerd and want to know everything :) ), but YAY!!! Thank you!

You are welcome and thanks for the feedback.

M.
 
Upvote 0

Forum statistics

Threads
1,215,063
Messages
6,122,928
Members
449,094
Latest member
teemeren

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