Combine two named ranges into a 3rd named range

mc-lemons

Board Regular
Joined
Apr 30, 2012
Messages
54
Office Version
  1. 365
Platform
  1. Windows
Hi all,

Please first have a look at this link so that you may follow me:
Merge two columns into one list in excel | Get Digital Help - Microsoft Excel resource

I would like to combine List1 and List2 into a 3rd named range called List3. I was wondering if this were possible without using any additional cells/columns (i.e. I don’t want to use Column C like in the example shown in the link above).

Here'e the formula from the example:

Code:
=IFERROR(INDEX(List1,ROWS(C1:$C$1)),IFERROR(INDEX(List2,ROWS(C1:$C$1)-ROWS(List1)),""))

I've played around with it, but could not come with any that worked.

Any help is greatly appreciated.

Thanks for looking!
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
Hi all,

Please first have a look at this link so that you may follow me:
Merge two columns into one list in excel | Get Digital Help - Microsoft Excel resource

I would like to combine List1 and List2 into a 3rd named range called List3. I was wondering if this were possible without using any additional cells/columns (i.e. I don’t want to use Column C like in the example shown in the link above).

Here'e the formula from the example:

Code:
=IFERROR(INDEX(List1,ROWS(C1:$C$1)),IFERROR(INDEX(List2,ROWS(C1:$C$1)-ROWS(List1)),""))

I've played around with it, but could not come with any that worked.

Any help is greatly appreciated.

Thanks for looking!

If you add the ARRAYUNION function, written in VBA, to your workbook, you can have:

List3, defined as referreing to:

=ARRAYUNION(List1,List2)

This is a horizontal array/vector; the following will be vertical...

=TRANSPOSE(ARRAYUNION(List1,List2))

Here is ArrayUnion if interested:

________________________
Function ArrayUnion(ParamArray Arg() As Variant) As Variant
' Code: Juan Pablo González
' Spec: Aladin Akyurek
' May 4, 2003
' Ref: TinyURL.com - shorten that long URL into a tiny URL
Dim TempUnion() As Variant
Dim i As Long, Itm As Variant, Ctr As Long
For i = LBound(Arg) To UBound(Arg)
Arg(i) = Arg(i)
If IsArray(Arg(i)) Then
For Each Itm In Arg(i)
Ctr = Ctr + 1
ReDim Preserve TempUnion(1 To Ctr) As Variant
TempUnion(Ctr) = Itm
Next Itm
Else
Ctr = Ctr + 1
ReDim Preserve TempUnion(1 To Ctr) As Variant
TempUnion(Ctr) = Arg(i)
End If
Next i
ArrayUnion = TempUnion
End Function
________________________
 
Upvote 0
Aldain,

Thanks for sharing! Thats a nice little UDF.

As many times is my problem, I am not sure if all users can use VBA, so i was looking for a non-VBA approach. (I forgot to mention that in the original post)

Thanks again for the help.
 
Upvote 0
Aldain,

Thanks for sharing! Thats a nice little UDF.

As many times is my problem, I am not sure if all users can use VBA, so i was looking for a non-VBA approach. (I forgot to mention that in the original post)

Thanks again for the help.

I am aware of the request. This is, while VBA, a functional solution.
 
Upvote 0

Forum statistics

Threads
1,214,979
Messages
6,122,551
Members
449,088
Latest member
davidcom

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