Intersect in a formula

Jeffrey Mahoney

Well-known Member
Joined
May 31, 2015
Messages
2,797
Office Version
  1. 365
Platform
  1. Windows
I learned today that I can return a range from the intersect of two ranges by doing this
=3:14 A:W
Returns A3:W14
There is a space separating those two ranges

Now, how do I get the entire row from a range? If I want to return 3:20 if I have a range A3:A20. More important, I want to give it a named range and have it return the entire row of that range.
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
that is pretty neat!

Try:

Excel Formula:
=3:20 3:20
or just
Excel Formula:
=3:20

or stripping away the column letters:

Excel Formula:
=INDIRECT(SUBSTITUTE("A3:A20","A",""))
i'm not sure if that is what you want, though.
 
Upvote 0
So here is how I want to use it. It would be similar to VBA code like this:
Rng = Intersect(Range("LE_UpperIDCol").EntireRow,Range("LE_Adj[Auto Adjust]"))
This would give me the same set of rows as LE_UpperIDCol but in the LE_Adj[Auto Adjust] column

I keep getting surprised by Excel, so I thought there must be somebody out there that has done this.

I tried getting the row of the upper cell and the row of the lower cell in the LE_UpperIDCol range and use it like this:
=MIN(ROW(LE_UpperIDCol)):max(ROW(LE_UpperIDCol))
But Excel won't let me use formulas to get the rows like =4:738

Jeff
 
Upvote 0
So here is how I want to use it. It would be similar to VBA code like this:
Rng = Intersect(Range("LE_UpperIDCol").EntireRow,Range("LE_Adj[Auto Adjust]"))
This would give me the same set of rows as LE_UpperIDCol but in the LE_Adj[Auto Adjust] column

I keep getting surprised by Excel, so I thought there must be somebody out there that has done this.

I tried getting the row of the upper cell and the row of the lower cell in the LE_UpperIDCol range and use it like this:
=MIN(ROW(LE_UpperIDCol)):max(ROW(LE_UpperIDCol))
But Excel won't let me use formulas to get the rows like =4:738

Jeff
why don't you post a sample of your data? And then below that an example of expected results.

Have you tried using the range reference feature of the INDEX function?
 
Upvote 0
Is this maybe what you want?:

Book1
ABCDE
112
234
3
412
534
Sheet2
Cell Formulas
RangeFormula
D4:E5D4=INDIRECT("1:2") INDIRECT("A:B")
Dynamic array formulas.


But as @awoohaw said if you explain what you want to accomplish we may come up with other (maybe better) solutions.
 
Upvote 0
My data is too sensitive to post.

My table has an upper half and a lower half. I want to be able to quantify the values in the top half separately. I have a dynamic named range in the left most column that contains project IDs called LE_UpperIDCol which is only one column wide. The number of rows in this dynamic range will change. There are 20 fields in this table. I didn't want to create 20 different named ranges for each field in the upper section. So . . . .

I was needing the intersection of each column related to the rows in the dynamic range LE_UpperIDCol. What I have done to solve it is to create another dynamic named range called LE_Upper which has the same rows as the other range but also includes all the columns in the table. Now I can create an intersect formula that will quantify the top half of the table like this:
=SUM(LE_Upper LE_Adj[DATA])
and
=COUNTIF(LE_Upper LE_Adj[Auto Adjust],"X")

Thank you everybody for helping.
 
Upvote 0
Solution

Forum statistics

Threads
1,215,143
Messages
6,123,277
Members
449,093
Latest member
Vincent Khandagale

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