Home

Merging text column

%3CLINGO-SUB%20id%3D%22lingo-sub-389961%22%20slang%3D%22en-US%22%3EMerging%20text%20column%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-389961%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20all%2C%26nbsp%3B%3C%2FP%3E%3CP%3EI%20want%20to%20merge%202%20column%20A%20and%20B%20and%20have%20result%20in%20column%20C%20(follow%20picture).%20In%20this%20case%20I%20use%26nbsp%3B%20%3CSPAN%20class%3D%22%20default-formula-text-color%22%3ECONCATENATE%3C%2FSPAN%3E%3CSPAN%20class%3D%22%20default-formula-text-color%22%3E(%3C%2FSPAN%3E%3CSPAN%3E%24A%241%3C%2FSPAN%3E%3CSPAN%20class%3D%22%20default-formula-text-color%22%3E%2C%3C%2FSPAN%3E%3CSPAN%20class%3D%22%20string%20%22%3E%22%20%22%3C%2FSPAN%3E%3CSPAN%20class%3D%22%20default-formula-text-color%22%3E%2C%3C%2FSPAN%3E%3CSPAN%3EB2%3C%2FSPAN%3E%3CSPAN%20class%3D%22%20default-formula-text-color%22%3E)%26nbsp%3B%20and%26nbsp%3B%20CONCATENATE(%3CSPAN%3E%24A%242%3C%2FSPAN%3E%2C%3CSPAN%20class%3D%22%20string%20%22%3E%22%20%22%3C%2FSPAN%3E%2C%3CSPAN%3EB2%3C%2FSPAN%3E)%26nbsp%3Bbut%20it's%20slowly.%20Can%20I%20use%20only%20one%20query%20for%20this%20case.%20Please%20help%20me.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20399px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F100386iCDE09DD80637593C%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22Screenshot_9.png%22%20title%3D%22Screenshot_9.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-389961%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%20Online%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-389983%22%20slang%3D%22en-US%22%3ERe%3A%20Merging%20text%20column%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-389983%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F309677%22%20target%3D%22_blank%22%3E%40lacala11%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20'natural'%20concatenation%20of%20the%202%20lists%20would%20produce%20an%20array%3C%2FP%3E%3CTABLE%20border%3D%220%22%20cellspacing%3D%220%22%20cellpadding%3D%220%22%3E%3CTBODY%3E%3CTR%3E%3CTD%3E%3CFONT%20color%3D%22%23000000%22%20face%3D%22Calibri%22%3EA1%20B1%3C%2FFONT%3E%3C%2FTD%3E%3CTD%3E%3CFONT%20color%3D%22%23000000%22%20face%3D%22Calibri%22%3EA2%20B1%3C%2FFONT%3E%3C%2FTD%3E%3C%2FTR%3E%3CTR%3E%3CTD%3E%3CFONT%20color%3D%22%23000000%22%20face%3D%22Calibri%22%3EA1%20B2%3C%2FFONT%3E%3C%2FTD%3E%3CTD%3E%3CFONT%20color%3D%22%23000000%22%20face%3D%22Calibri%22%3EA2%20B2%3C%2FFONT%3E%3C%2FTD%3E%3C%2FTR%3E%3CTR%3E%3CTD%3E%3CFONT%20color%3D%22%23000000%22%20face%3D%22Calibri%22%3EA1%20B3%3C%2FFONT%3E%3C%2FTD%3E%3CTD%3E%3CFONT%20color%3D%22%23000000%22%20face%3D%22Calibri%22%3EA2%20B3%3C%2FFONT%3E%3C%2FTD%3E%3C%2FTR%3E%3CTR%3E%3CTD%3E%3CFONT%20color%3D%22%23000000%22%20face%3D%22Calibri%22%3EA1%20B4%3C%2FFONT%3E%3C%2FTD%3E%3CTD%3E%3CFONT%20color%3D%22%23000000%22%20face%3D%22Calibri%22%3EA2%20B4%3C%2FFONT%3E%3C%2FTD%3E%3C%2FTR%3E%3CTR%3E%3CTD%3E%3CFONT%20color%3D%22%23000000%22%20face%3D%22Calibri%22%3EA1%20B5%3C%2FFONT%3E%3C%2FTD%3E%3CTD%3E%3CFONT%20color%3D%22%23000000%22%20face%3D%22Calibri%22%3EA2%20B5%3C%2FFONT%3E%3C%2FTD%3E%3C%2FTR%3E%3C%2FTBODY%3E%3C%2FTABLE%3E%3CP%3EIt%20is%20unpivoting%20the%20array%20to%20a%20single%20list%20that%20is%20messy.%26nbsp%3B%3C%2FP%3E%3CP%3EIf%20one%20defines%20an%20index%20'k'%20for%20the%20desired%20result%20array%3C%2FP%3E%3CP%3E%3D%20ROW(result)%3C%2FP%3E%3CP%3Ethen%20row%20and%20column%20indices%20'I'%2C%20'J'%20for%20the%20corresponding%20cell%20in%20the%20concatenation%20are%20given%20by%3C%2FP%3E%3CP%3E%3D%201%20%2B%20MOD(%20k-1%2C%205%20)%3C%2FP%3E%3CP%3E%3D%20CEILING(%20k%2C%205)%20%2F%205%3C%2FP%3E%3CP%3Erespectively%2C%20where%20the%205s%20correspond%20to%20the%20number%20of%20rows%20in%20B.%26nbsp%3B%20The%20result%20array%20is%20given%20by%3C%2FP%3E%3CP%3E%3D%20INDEX(%20concat%2C%20I%2C%20J%20)%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-389979%22%20slang%3D%22en-US%22%3ERe%3A%20Merging%20text%20column%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-389979%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F309677%22%20target%3D%22_blank%22%3E%40lacala11%3C%2FA%3E%26nbsp%3B%2C%20that%20could%20be%20as%3C%2FP%3E%0A%3CPRE%3E%3DOFFSET(%24A%241%2CINT((ROW()-1)%2FROWS(%24B%241%3A%24B%245))%2C0)%26amp%3B%22%20%22%26amp%3B%20OFFSET(%24B%241%2CMOD(ROW()-1%2CROWS(%24B%241%3A%24B%245))%2C0)%3C%2FPRE%3E%0A%3CP%3Eand%20drag%20it%20down.%20Is%20to%20be%20adjusted%20to%20your%20actual%20ranges%20and%2For%20you%20may%20use%20dynamic%20ranges.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
lacala11
Occasional Visitor

Hi all, 

I want to merge 2 column A and B and have result in column C (follow picture). In this case I use  CONCATENATE($A$1," ",B2)  and  CONCATENATE($A$2," ",B2) but it's slowly. Can I use only one query for this case. Please help me.

 

Screenshot_9.png

2 Replies

@lacala11 , that could be as

=OFFSET($A$1,INT((ROW()-1)/ROWS($B$1:$B$5)),0)&" "& OFFSET($B$1,MOD(ROW()-1,ROWS($B$1:$B$5)),0)

and drag it down. Is to be adjusted to your actual ranges and/or you may use dynamic ranges.

 

@lacala11 

The 'natural' concatenation of the 2 lists would produce an array

A1 B1A2 B1
A1 B2A2 B2
A1 B3A2 B3
A1 B4A2 B4
A1 B5A2 B5

It is unpivoting the array to a single list that is messy. 

If one defines an index 'k' for the desired result array

= ROW(result)

then row and column indices 'I', 'J' for the corresponding cell in the concatenation are given by

= 1 + MOD( k-1, 5 )

= CEILING( k, 5) / 5

respectively, where the 5s correspond to the number of rows in B.  The result array is given by

= INDEX( concat, I, J )

Related Conversations
Tabs and Dark Mode
cjc2112 in Discussions on
46 Replies
Extentions Synchronization
Deleted in Discussions on
3 Replies
Stable version of Edge insider browser
HotCakeX in Discussions on
35 Replies
How to Prevent Teams from Auto-Launch
chenrylee in Microsoft Teams on
30 Replies
flashing a white screen while open new tab
Deleted in Discussions on
14 Replies
Security Community Webinars
Valon_Kolica in Security, Privacy & Compliance on
13 Replies