Selecting values from different rows in a table and merge them in order in a sinlge row

FromF

New Member
Joined
Sep 5, 2014
Messages
3
Hi,

I want to use a formula, or set of formulas, for selecting values from a data table were the number of values differ between rows (see attachment). I do not want to cut and paste or use any commands as I need to make this a executable function.

For instance, 9 rows and 21 cols (as in attachment), in the first row i have 21 values, in the 2nd only 4 and in the 3rd I have 5 etc. I want to "merge" these values in order in a single row, i.e. from B2 to V2 (in this case) and then continue with B3 to E3, and B4 to F4 etc, all in a single new row.

So in the table I have a total of 103 values in 9 rows, i want to sort them in a single row, i.e. from e.g. B15 to CZ15 (I think it will be CZ).

Height of cross section BC D E F ... .. .
00,050,090,140,180,230,270,320,360,410,450,500,550,590,640,680,730,770,820,860,911,00
11,251,501,752,00
22,202,402,602,803,00
33,173,333,503,673,834,00
44,134,254,384,504,634,754,885,00
55,115,225,335,445,565,675,785,896,00
66,076,146,216,296,366,436,506,576,646,716,796,866,937,00
77,107,207,307,407,507,607,707,807,908,00
88,078,148,218,298,368,438,508,578,648,718,798,868,939,00
99,169,339,499,659,829,9810,1510,3110,4710,6410,80
10,8

<tbody>
</tbody>


Thanks!
Fredrik
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
English is not my first language so i might not have explained it very well. I have added a smaller sample of my data with the desired result and the result from the original StringConcat.

Height
00,050,090,140,180,230,270,320,360,410,450,500,550,590,640,680,730,770,820,860,911,00
11,251,501,752,00
22,202,402,602,803,00

<tbody>
</tbody>

So what i want to do is to put the values from all rows in one single row like this:


(from row 2)(From row 3)(From row 4)
Desired result ->0,050,090,140,180,230,270,320,360,410,450,500,550,590,640,680,730,770,820,860,911,001,251,501,752,002,202,402,602,803,00

<tbody>
</tbody>


with one cell for each value.

When I use the "=StringConcat("|";B2:W4)" all values are merged in one cell.

Using UDF StringConcat ->0,045455|0,090909|0,136364|0,181818|0,227273|0,272727|0,318182|0,363636|0,409091|0,454545|0,5|0,545455|0,590909|0,636364|0,681818|0,727273|0,772727|0,818182|0,863636|0,909091|1|1,25|1,5|1,75|2|2,2|2,4|2,6|2,8|3

<tbody>
</tbody>

I could use copy and paste special (values) to put the information from StringConcat in a new cell and then use the command text to columns to separate the values in to separate cells for each value, however, I want to use a function(s) instead of commands as I need to make this an executable function.

Cheers!
Fredrik
 
Upvote 0
Sorry I misunderstood. Formula in B6 copied across:


Excel 2010
ABCDEFGHIJKLMNOP
1Height
200,050,090,140,180,230,27
311,251,501,752,00
422,202,402,602,803,00
5
6Result0,050,090,140,180,230,271,251,501,752,002,202,402,602,803,00
Sheet1
Cell Formulas
RangeFormula
B6{=IFERROR(INDIRECT(TEXT(SMALL(IF($B$2:$G$4<>"",ROW($B$2:$G$4)*10^4+COLUMN($B$2:$G$4)),COLUMNS($B6:B6)),"R0000C0000"),0),"")}
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0

Forum statistics

Threads
1,214,924
Messages
6,122,294
Members
449,077
Latest member
Rkmenon

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