APPEND2H

=APPEND2H(a,b,i)

a
array
b
array to be appended to the right of a
i
index, ignored or 0 or 1 append entire arrays, i>1 acts like column index of array b

APPEND2H appends 2 arrays horizontally.

Xlambda

Well-known Member
Joined
Mar 8, 2021
Messages
860
Office Version
  1. 365
Platform
  1. Windows
APPEND2H !! recursive !! appends 2 arrays horizontally
Excel Formula:
=LAMBDA(a,b,i,
    LET(j,MAX(1,i),
      ca,COLUMNS(a),cb,COLUMNS(b),s,SEQUENCE(,ca+1),
      IF(j=cb+1,IFNA(a,""),APPEND2H(IF(s=ca+1,INDEX(IF(b="","",b),,j),IF(a="","",a)),b,j+1))
    )
)
LAMBDA 5.0.xlsm
ABCDEFGHI
1a1XYZ
2b2ABC
3c3
4for appending entire arrays,i can be ignored 0 or 1
5a1XYZ
6b2ABC
7c3
8ex1:use of index(i) argument (>1),when 2nd array is already defined as a table or name
9(acts like a replace) (if I > columns(b) leaves a as it is
101Item A1Product Ared23sold
112Item B2Product Bgreen34stock
123Item C3Product Cwhite45sold
13i=3
141Item Ared23sold
152Item Bgreen34stock
163Item Cwhite45sold
17
18ex2: to append a date or any other row of an array 15-03-21
19 =APPEND2H(--"15-3-21",D10:H12,2)
2015-03-21Product Ared23sold
2115-03-21Product Bgreen34stock
2215-03-21Product Cwhite45sold
23
24ex3: append dates sequence =APPEND2H(SEQUENCE(3,,"15-3-21"),D10:H12,2)
2515-03-21Product Ared23sold
2616-03-21Product Bgreen34stock
2717-03-21Product Cwhite45sold
28
29ex4: create unusual sequences array =APPEND2H(SEQUENCE(3),SEQUENCE(,3,4),)
301456
312456
323456
33
APPEND2H
Cell Formulas
RangeFormula
A5:E7A5=APPEND2H(A1:B3,D1:F2,)
A14:E16A14=APPEND2H(A10:B12,D10:H12,3)
A20:E22A20=APPEND2H(--"15-3-21",D10:H12,2)
A25:E27A25=APPEND2H(SEQUENCE(3,,"15-3-21"),D10:H12,2)
A30:D32A30=APPEND2H(SEQUENCE(3),SEQUENCE(,3,4),)
Dynamic array formulas.
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,337
Members
452,637
Latest member
Ezio2866

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