Extracting Data Using Array Aggregate & Multiple Sheets

DoctorK

New Member
Joined
Dec 1, 2016
Messages
12
Hi,

I'm using version 2013 and find that the Aggregate function makes the extraction somewhat easier.

One small issue I've overcome by that I set up a separate table to reference the values from the source sheet to help my formula because I have 4 ranges to reference and they're not consecutive and there are "too many arguments". So on the reference table, I'm using an If statement.


Code:
 =IF('DID Ranges & Phone Numbers'!$B18="","",'DID Ranges & Phone Numbers'!$B18)

This is referenced on the 'Data sheet do not delete' N2:N225

On my sheet where I want to extract the lines to ('TN Detail Porting') This is the formula I have for my array.
Code:
 =IF(ROWS(B$9:B9)>COUNTA('DATA SHEET DO NOT DELETE!'!$N$2:$N$225),"",INDEX('DATA SHEET DO NOT DELETE!'!$N$2:$N$225,AGGREGATE(15,7,(ROW('DATA SHEET DO NOT DELETE!'!$N$2:$N$225)-ROW('DATA SHEET DO NOT DELETE!'!$N$2)+1)/('DATA SHEET DO NOT DELETE!'!$N$2:$N$225<>""),ROWS(B$9:B9))))

I have all of my numbers ascending from the top like I want, but the IF statement isn't having any kind of effect to remove the blanks that are below my numbers and are generating the "#NUM!" error. I can't figure out what is causing this because the logic checks out.

Any ideas?



Thank you!


~Doctor K
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
Hard to tell without seeing the worksheets, but for the formula on the 'TN Detail Porting' sheet, wouldn't this cause a #DIV/0 error for any blank cell?

Code:
/('DATA SHEET DO NOT DELETE!'!$N$2:$N$225<>"")

Perhaps you should use multiplication instead?

Just a thought.
 
Upvote 0
It does, but the Aggregate option allows the ability to ignore errors. In this case, it's option 7 - why it won't ignore the #NUM! error, I don't know.
Code:
[COLOR=#333333]AGGREGATE(15,[/COLOR][COLOR=#ff0000]7[/COLOR][COLOR=#333333],[/COLOR]
(Ignore hidden rows and error values). I think I understand where my problem is at. The range that I am referencing is based off of a formula that is depended upon another sheet's input. Because it's off of a formula, the source data is blank or has input and the reference sheet is based on a condition and so that means the COUNTA operator will only return a higher number than the current row I set it to. I can't substitute anything like a dash or dot or otherwise the numbers won't be ascending from the top. =(

I've made a work around and made a conditional statement on the error instead.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,622
Messages
6,120,580
Members
448,972
Latest member
Shantanu2024

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