Wraprows for Excel 2019 version

ExcelNewbie2020

Active Member
Joined
Dec 3, 2020
Messages
343
Office Version
  1. 365
Platform
  1. Windows
For Excel version 2019


i have this table.. my formula returns horizontally the same as source data. i would like to arrange it vertically by group of 3. would it be possible using excel 2019?


Excel.xlsm
ABCDEFG
1NicknameAmount1OR No.1Date1Amount2OR No.2Date2
2Chile36.97111-Jul-20244641416-Oct-2024
3Rwanda72.8422-Oct-202472.8422-Oct-2024
4Ethiopia21.22325-Feb-202421.22325-Feb-2024
5Zimbabwe6.47427-Jun-20246.47427-Jun-2024
6Uganda66.79523-Nov-202466.79523-Nov-2024
7Uzbekistan42.8769-May-202442.8769-May-2024
8Sudan62.34724-Jun-202462.34724-Jun-2024
9Tonga54.11817-May-202454.11817-May-2024
10Poland62.84914-Dec-202462.84914-Dec-2024
11Panama66.381030-Nov-202466.381030-Nov-2024
12
13
14
15
16
17
18SEARCHCHILE
19CURRENT FORMULA RESULT
20Amount1OR No.1Date1Amount2OR No.2Date2
2136.97111-07-244641416-10-24
22
23
24
25
26EXPECTED RESULT
27AmountORDATE
2836.97111-07-24
294641416-10-24
30
31
32
AGRESEARCH (2)
Cell Formulas
RangeFormula
B21:G21B21=IFERROR(INDEX($B$2:$G$14,AGGREGATE(15,6,(ROW($B$2:$B$14)-ROW($B$2)+1)/(ISNUMBER(SEARCH($C$18,$A$2:$A$14)) ),ROWS($B$21:B21)),COLUMNS($B$21:B21)),"")
 

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
Power Query:

Power Query:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    cols = {"Amount","OR","DATE"},
    toList = Table.ToColumns(Table.RemoveColumns(Source,{"Nickname"})),
    comb = List.Accumulate({{0,3},{3,3}},#table({}, {}),(s,c)=> Table.Combine({s, Table.FromColumns(List.Range(toList,c{0},c{1}),cols)})),
    result = Table.Sort(comb,{{"OR", Order.Ascending}})
in
    result

1716802435976.png
 
Upvote 0
Here another code with less custom functions

Power Query:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    t1 = Table.SelectColumns(Source,{"Amount1", "OR No.1", "Date1"}),
    t2 = Table.RenameColumns(Table.SelectColumns(Source,{"Amount2", "OR No.2", "Date2"}),{{"Amount2", "Amount1"}, {"OR No.2", "OR No.1"}, {"Date2", "Date1"}}),
    result = Table.Sort(Table.Combine({t1,t2}),{{"OR No.1", Order.Ascending}})
in
    result
 
Upvote 0
Here another code with less custom functions

Power Query:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    t1 = Table.SelectColumns(Source,{"Amount1", "OR No.1", "Date1"}),
    t2 = Table.RenameColumns(Table.SelectColumns(Source,{"Amount2", "OR No.2", "Date2"}),{{"Amount2", "Amount1"}, {"OR No.2", "OR No.1"}, {"Date2", "Date1"}}),
    result = Table.Sort(Table.Combine({t1,t2}),{{"OR No.1", Order.Ascending}})
in
    result
thanks man, i am looking for a modified version of my current formula that will give the expected output..
 
Upvote 0
I don't have xl2bb here, so:

Put the headers exactly in the same cells as I did. --> B14 : D14
then put this formula in B15 and pull down and right.

Excel Formula:
=INDEX($B$2:$G$11,INT((ROW(A1)-1)/2)+1,MOD(COLUMN(A1)-1,3)+IF(MOD(COUNTA($B$14:$B14),2),1,4))

1716819264609.png
 
Upvote 0
I don't have xl2bb here, so:

Put the headers exactly in the same cells as I did. --> B14 : D14
then put this formula in B15 and pull down and right.

Excel Formula:
=INDEX($B$2:$G$11,INT((ROW(A1)-1)/2)+1,MOD(COLUMN(A1)-1,3)+IF(MOD(COUNTA($B$14:$B14),2),1,4))

View attachment 111944
thanks, maybe you overlook on my current formula, there is a search criteria at C18..Like for example, if i search for CHILE the result will be thes
1716820500201.png
 
Upvote 0
Yes I missed that

Excel Formula:
=INDEX($B$2:$G$11,MATCH($B$13,$A$2:$A$11),(COLUMN(A1)-1)+IF(MOD(COUNTA($B$14:$B14),2),1,4))

1716821660264.png
 
Upvote 0
Yes I missed that

Excel Formula:
=INDEX($B$2:$G$11,MATCH($B$13,$A$2:$A$11),(COLUMN(A1)-1)+IF(MOD(COUNTA($B$14:$B14),2),1,4))

View attachment 111947
thanks man, it did work.. however, i forgot to mention that my data has morethan 6 column wide index range. i have a total of 30 column wide index range and its values is regularly updated.
i think the formula is designed only for a 6column wide range?
 
Upvote 0

Forum statistics

Threads
1,223,896
Messages
6,175,262
Members
452,627
Latest member
KitkatToby

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