diff --git a/README.md b/README.md index 5343d76..0f80061 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,28 @@ Donations will go towards getting CPA validation of the calculations I'm using a Using github project for planning - see [Timeline](https://github.com/users/hickeng/projects/2/views/2) + + +## [v0.1.1](https://github.com/hickeng/financial/releases/tag/v0.1.0) - 2024-02-20 + +Adds per-lot treatment mechanism in the RSU and ESPP datasheets: + +* select preference per-lot for `cash` or `shares` +* run the optimizer to automatically adjust lot preference for maximum deferred tax (see steps below) + + +There's [a binary sheet](https://github.com/hickeng/financial/releases/download/v0.1.1/VMW_to_AVGO_ESPP_and_RSU-v0.1.1-github.xlsx) attached to the releases, suitable for import into Google Sheets. + +1. Download [the sheet](https://github.com/hickeng/financial/releases/download/v0.1.1/VMW_to_AVGO_ESPP_and_RSU-v0.1.1-github.xlsx) +2. Create a new Google Sheet - [open this in new window](https://docs.google.com/spreadsheets/u/0/create?usp=sheets_home&ths=true) +3. Go to File->Import->Upload->Browse - this will open a system file selection box. Select the downloaded sheet. +4. Choose `Replace Spreadsheet`, and select `Import data` +5. Import the AppScript (needed for running lot optimization) + 1. In the sheet, `Extensions->App Scripts` and copy the .gs files from the repo worksheet directory. You can just pasted them all into one large file if need be. + 2. Either reload the spreadsheet, or run the `common.gs:onOpen` function using the AppScript UI +6. Go to the new sheet menu `Custom Functions->Optimize per-lot selection` + 1. This should set the preference for each lot to `cash` or `shares` and you'll see the impact if choosing `manual per-lot ratio` in the Tweaks. + ## [v0.1.0](https://github.com/hickeng/financial/releases/tag/v0.1.0) - 2024-02-18 Initial tagged release because the foundation is there: @@ -22,13 +44,7 @@ Initial tagged release because the foundation is there: * basic outputs are complete - per-lot cash amounts, gain, old adjusted vmw basis, and new avgo basis are calculated considering short/long term gain and ESPP qualified/disqualified status * all planned changes are enhancements -There's [a binary sheet](https://github.com/hickeng/financial/releases/download/v0.1.0/VMW_to_AVGO_ESPP_and_RSU-v0.1.0-github.xlsx) attached to the release, suitable for import into Google Sheets. -I've been able to: -1. Download [the sheet](https://github.com/hickeng/financial/releases/download/v0.1.0/VMW_to_AVGO_ESPP_and_RSU-v0.1.0-github.xlsx) -2. Create a new Google Sheet - [open this in new window](https://docs.google.com/spreadsheets/u/0/create?usp=sheets_home&ths=true) -3. Go to File->Import->Upload->Browse - this will open a system file selection box. Select the downloaded sheet. -4. Choose `Replace Spreadsheet`, and select `Import data` # Contents diff --git a/VMW_to_AVGO_ESPP_and_RSU.xlsx b/VMW_to_AVGO_ESPP_and_RSU.xlsx index 8c83ed9..58a6712 100644 Binary files a/VMW_to_AVGO_ESPP_and_RSU.xlsx and b/VMW_to_AVGO_ESPP_and_RSU.xlsx differ diff --git a/worksheet/export.gs b/worksheet/export.gs index e0b2d0d..8409564 100644 --- a/worksheet/export.gs +++ b/worksheet/export.gs @@ -1,17 +1,3 @@ - -// Install menu items -function onOpen() { - var ui = SpreadsheetApp.getUi() - ui.createMenu("Custom Functions") - .addItem("Export Workbook (with Data)", "serializeStandard") - .addItem("Export Workbook (Censored)", "serializeCensored") - .addItem("Export Workbook (Debug)", "serializeDebug") - .addItem("Export Active Sheet (with Data)", "serializeActiveStandard") - .addItem("Export Active Sheet(Censored)", "serializeActiveCensored") - .addItem("Export Active Sheet (Debug)", "serializeActiveDebug") - .addToUi() -} - ///////////////////////// // Serialization diff --git a/worksheet/github_hickeng_financial_vmw_avgo_merger_data_ESPP.json b/worksheet/github_hickeng_financial_vmw_avgo_merger_data_ESPP.json index e17b505..7d018ac 100644 --- a/worksheet/github_hickeng_financial_vmw_avgo_merger_data_ESPP.json +++ b/worksheet/github_hickeng_financial_vmw_avgo_merger_data_ESPP.json @@ -88,9 +88,7 @@ {"sheet":1,"id":"I3","data":"Derived - should match vlaues from ESPP purchase confirmation"}, {"sheet":1,"id":"I4","data":"Previous Carry Forward"}, {"sheet":1,"id":"I7","format":"financial","dataclass":"in","note":"Put the Previous Carry Forward form your earliest ESPP confirmation for shares you still own into this cell and it'll propagate down.\nIt doesn't matter that it's on a different row as it's only when you start purchasing shares that it'll have an effect.\nAlternatively you can 0 those rows for which you don't have a purchase and enter your earliest Carry Forward into the precise row."}, -{"sheet":1,"id":"I8","data":"=K7","type":"formula","format":"financial","propagate":{"end":"I10"},"dataclass":"in_prepop"}, -{"sheet":1,"id":"I11","format":"financial","dataclass":"in"}, -{"sheet":1,"id":"I12","data":"=K11","type":"formula","format":"financial","propagate":{"end":"I26"},"dataclass":"in_prepop"}, +{"sheet":1,"id":"I8","data":"=K7","type":"formula","format":"financial","propagate":{"end":"I26"},"dataclass":"in_prepop"}, {"sheet":1,"id":"J4","data":"Total Contributions"}, {"sheet":1,"id":"J7","data":"=I7+G7","type":"formula","format":"financial","propagate":{"end":"J26"},"dataclass":"info"}, {"sheet":1,"id":"K4","data":"Carry Forward"}, diff --git a/worksheet/github_hickeng_financial_vmw_avgo_merger_data_RSU.json b/worksheet/github_hickeng_financial_vmw_avgo_merger_data_RSU.json index 737c10e..f4d0007 100644 --- a/worksheet/github_hickeng_financial_vmw_avgo_merger_data_RSU.json +++ b/worksheet/github_hickeng_financial_vmw_avgo_merger_data_RSU.json @@ -146,9 +146,7 @@ {"sheet":2,"id":"I3","data":"Input - alternate for cross check","format":"int_3dp"}, {"sheet":2,"id":"I4","data":"Share amounts from eTrade","format":"int_3dp","note":"The quantities of converted shares from eTrade lots.\nThe colour of the cell will alter slightly if the value here does not equal the value calculated via AVGO ratio.\nYou can toggle whether to use this manual value or the calculated value in the Tweaks on the first Sheet."}, {"sheet":2,"id":"I5","data":"=SUM(I7:I84)","type":"formula","format":"int_3dp","dataclass":"info"}, -{"sheet":2,"id":"I7","format":"int_3dp","propagate":{"end":"I8"},"dataclass":"in_opt"}, -{"sheet":2,"id":"I9","format":"int_3dp","dataclass":"in_opt","note":"This is NOT the value in eTrade for this lot - it is the value in eTrade + the fractional share that was sold from this lot.\nThis is done to keep the rest of the sheet sane so there isn't an exception that applies to a single row."}, -{"sheet":2,"id":"I10","format":"int_3dp","propagate":{"end":"I84"},"dataclass":"in_opt"}, +{"sheet":2,"id":"I7","format":"int_3dp","propagate":{"end":"I84"},"dataclass":"in_opt"}, {"sheet":2,"id":"I86","data":"=SUM(I7:I84)","type":"formula","format":"int_3dp","dataclass":"info"}, {"sheet":2,"id":"J3","data":"Use for fraction","format":"int_3dp","note":"If the fractional share should come out of a specific lot, or set of lots, check those lots here. If multiple are selected the sheet will spread the fraction equally over those lots, accounting for differences in cost-basis.\nYou REALLY don't want it to come out of an ESPP lot as that's a sale and will incur the ordinary income portion of tax shown in column AB.\nFor me, eTrade took the entire fraction from a single lot and I expect that's what happened for most people."}, {"sheet":2,"id":"J5","data":"=COUNTIF(#REF!, TRUE)","type":"formula"}, diff --git a/worksheet/github_hickeng_financial_vmw_avgo_merger_data_Reference.json b/worksheet/github_hickeng_financial_vmw_avgo_merger_data_Reference.json index dd9657b..983932f 100644 --- a/worksheet/github_hickeng_financial_vmw_avgo_merger_data_Reference.json +++ b/worksheet/github_hickeng_financial_vmw_avgo_merger_data_Reference.json @@ -1,4 +1,4 @@ -{"sheet":0,"id":"_","name":"Reference","conditional_formatting":{"type":"","criteria":"","args":[],"ranges":[],"effect":[]}}, +{"sheet":3,"id":"_","name":"Reference","conditional_formatting":{"type":"","criteria":"","args":[],"ranges":[],"effect":[]}}, {"sheet":3,"id":"A1","data":"This Sheet is a collection of reference values used by the others. I do not expect anyone to need to make changes to these values."}, {"sheet":3,"id":"A3","data":"VMW final sale price"}, {"sheet":3,"id":"A4","data":"Cash ratio (calculated)"}, @@ -122,7 +122,7 @@ {"sheet":3,"id":"E4","data":"=SWITCH(Summary!K26,\"Calculated from Necessary Inputs\", \"eTradeHoldingRatio\",\"Calculated from manual share qty\",\"eTradeLotQtyRatio\", \"Manual per-lot ratio\", \"manualLotRatio\")","type":"formula"}, {"sheet":3,"id":"E5","data":"0","format":"int_6dp","dataclass":"in_prepop"}, {"sheet":3,"id":"E6","data":"1","format":"int_6dp","dataclass":"in_prepop"}, -{"sheet":3,"id":"E7","format":"int_6dp","dataclass":"info","note":"This is calculated to balance the ratio to meet the obligation of correct number of total shares across lots.\n"}, +{"sheet":3,"id":"E7","data":"=B5","type":"formula","format":"int_6dp","dataclass":"info","note":"This is calculated to balance the ratio to meet the obligation of correct number of total shares across lots.\n"}, {"sheet":3,"id":"E46","data":"0.24","format":"%"}, {"sheet":3,"id":"E47","data":"95375","format":"financial"}, {"sheet":3,"id":"E48","data":"190750","format":"financial"}, diff --git a/worksheet/github_hickeng_financial_vmw_avgo_merger_data_Summary.json b/worksheet/github_hickeng_financial_vmw_avgo_merger_data_Summary.json index 9968608..c307565 100644 --- a/worksheet/github_hickeng_financial_vmw_avgo_merger_data_Summary.json +++ b/worksheet/github_hickeng_financial_vmw_avgo_merger_data_Summary.json @@ -1,14 +1,15 @@ {"sheet":0,"id":"_","name":"Summary","conditional_formatting":{"type":"bool","criteria":"NUMBER_NOT_EQUAL_TO","args":["=B25+B26","=AND(EQ(K27, \"eTrade\"), NE(B30,C42))","=NE(K27,\"eTrade\")","=B42","=ROUNDDOWN(B26 * indirect(\"Reference!$B$6\"))"],"ranges":["B29","B30","B30","B30","B31","G42","F41"],"effect":["background: #DED5BA","background: #B7E1CD","background: #FF0000"]}}, -{"sheet":0,"id":"A1","data":"Colour Coding","dataclass":"info"}, +{"sheet":0,"id":"A1","data":"=\"Colour Coding\"","type":"formula","dataclass":"info"}, {"sheet":0,"id":"A2","dataclass":"in"}, {"sheet":0,"id":"A3","dataclass":"in_opt"}, {"sheet":0,"id":"A4","data":"Input - necessary but prepopulated where available","dataclass":"in_prepop","note":"Missing necessary info is likely to occur when you have an ESPP from prior to 2012 or an RSU vest date that I did not.\nIn those cases you should be able to extra this info from the confirmation docs."}, {"sheet":0,"id":"A5","dataclass":"in_ref"}, {"sheet":0,"id":"A6","data":"Output - relevent immediately","dataclass":"out_now"}, {"sheet":0,"id":"A7","data":"Output - relevent on future sale","dataclass":"out_future"}, -{"sheet":0,"id":"A8","data":"Calculated - intermediate or informational","dataclass":"info"}, +{"sheet":0,"id":"A8","data":"=\"Calculated - intermediate or informational\"","type":"formula","dataclass":"info"}, {"sheet":0,"id":"A9","data":"Labels"}, {"sheet":0,"id":"A10","data":"Example cell with additional note","note":"Sample note to illustrate the visual indication (black triangle in top right corner) of a cell note.\n"}, +{"sheet":0,"id":"A12","data":"Github Release: v0.1.1"}, {"sheet":0,"id":"A22","data":"Inputs (eTrade transaction log)"}, {"sheet":0,"id":"A24","data":"Necessary"}, {"sheet":0,"id":"A25","data":"Shares liquidated for cash (vmw)"},