rwmill9716

Active Member
Joined
May 20, 2006
Messages
493
Office Version
  1. 2013
Platform
  1. Windows
I have stock trading results in Columns AX through BD (hundreds of rows). I need formula for Columns BE through BI that will let me rearrange the data as shown. Essentially, I'm taking data that's presented as 1 row per symbol and converting it to 2 rows per symbol then rearranging the data as shown into those two rows: the 1/2 position trade results (date and profit) are moved to single columns.

Thanks for your help,

Ric


Excel 2010
AXAYAZBABBBCBDBEBFBGBHBI
20SymbolDate PurchasedPriceDate 1st half soldProfitDate 2nd half soldProfitSymbolDate PurchasedPriceDate 1/2 Position SoldProfit
21CC01/05/17$20.821/10/20172.251/10/2017$2.45CC1/5/2017$20.821/10/2017$2.25
22THO01/12/17$100.291/13/2017$2.501/19/2016$2.001/10/2017$2.45
23SF01/12/17$48.691/13/2017$3.001/13/2017$3.00THO1/12/2017$100.291/13/2017$2.50
24PAA01/19/17$30.531/24/2017$1.751/25/2017$1.501/19/2017$2.00
25WDC01/19/17$72.011/20/2017$1.251/20/2017$1.25SF1/12/2017$48.691/13/2017$3.00
26SCHN01/25/17$23.801/31/2017$0.552/1/2017$0.551/13/2017$3.00
2016 (2)
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
Just copy Symbol column into new sheet, make a space between each symbol using macro and then copy it back to col BE and then use vlookup formula to fetch the rest of the columns for that symbol.

I have stock trading results in Columns AX through BD (hundreds of rows). I need formula for Columns BE through BI that will let me rearrange the data as shown. Essentially, I'm taking data that's presented as 1 row per symbol and converting it to 2 rows per symbol then rearranging the data as shown into those two rows: the 1/2 position trade results (date and profit) are moved to single columns.

Thanks for your help,

Ric

Excel 2010
AXAYAZBABBBCBDBEBFBGBHBI
20SymbolDate PurchasedPriceDate 1st half soldProfitDate 2nd half soldProfitSymbolDate PurchasedPriceDate 1/2 Position SoldProfit
21CC 01/05/17$20.82 1/10/20172.251/10/2017$2.45 CC1/5/2017$20.82 1/10/2017$2.25
22THO 01/12/17$100.29 1/13/2017$2.50 1/19/2016$2.00 1/10/2017$2.45
23SF 01/12/17$48.69 1/13/2017$3.00 1/13/2017$3.00 THO1/12/2017$100.29 1/13/2017$2.50
24PAA 01/19/17$30.53 1/24/2017$1.75 1/25/2017$1.50 1/19/2017$2.00
25WDC 01/19/17$72.01 1/20/2017$1.25 1/20/2017$1.25 SF1/12/2017$48.69 1/13/2017$3.00
26SCHN 01/25/17$23.80 1/31/2017$0.55 2/1/2017$0.55 1/13/2017$3.00

<colgroup><col style="width: 25pxpx"><col><col><col><col><col><col><col><col><col><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
2016 (2)
 
Upvote 0
Thanks, Sunny,

What would the macro look like that would loop through 1000 of these rows? I like the Vlookup approach. Since the same symbol will occur multiple times, I will have to confine each vlookup formula to two rows and copy it down the list.

Ric
 
Upvote 0

Forum statistics

Threads
1,215,333
Messages
6,124,317
Members
449,153
Latest member
JazzSingerNL

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