%OP%TM1 %OP%BM1 %OP%LM5 %OP%HE/%H2%Z88 Users' Club Software Library%H2%/ %OP%FO/%H2%Z148%H2%//@P@/ %CO:A,12,70%%C%%H1%%H2%INCORPORATING YOUR INVESTMENTS - THE 'PORTFOLIO PROGRAM' Brian Shackel (0648) With the public share offers of the last few years, many people have a small 'portfolio' of shares and unit trusts. The spreadsheet capabilities, part of the basic 'PipeDream' application built into the Z88, enable us to keep an up-to-date view of their progress and value. This article shows a use of the spreadsheet capabilities built into the 'PipeDream' application. The simple 'program' which accompanies this document will present the current value and percentage profit (or loss) on a portfolio of shares and/or unit trusts. One can overtype the names, dates, price, number and cost of investments owned, and the current price of each from the city columns of share prices. As will probably be obvious from the position of the formulae, the automatic calculations provided by the spreadsheet operate to give the total of the Cost column (in cell E27), and to work out the results for the Current Value (F12 to F25) an d Profit +/-%PC% (G12 to G25) columns. The Current Value column is calculated automatically within the spreadsheet based upon the Latest column immediately to the right of the Profit +/-%PC% column. In this program I have assumed that you may only wish to keep the latest and the imm ediate previous column of Prices. However, as an alternative I show how you can keep more columns of past prices. At the end of the 'Portfolio Program' the exact method is given to move the last prices over and to enter the current Latest prices. Since the calculation of the Current Value column depends upon the latest prices being in column H, it is important that you do follow this procedure. Extra rows for more entries under shares or unit trusts are made by 'Insert row <>N' within the table immediately after row D or row F (in row 17 or 25). If you follow accurately the entries you will see and learn how some of the spreadsheet facilities work in the Z88. More important, you will be able to keep a regular and accurate check on the progress of your investments. By doing so, you may well be able to save or earn the cost of the Z88 in this way alone. %P0% %H1%%H2%The Portfolio Program%H2%%H1% - Z148B Type all entries exactly as listed below; <> and [] are used for the diamond and square keys, TAB for the TAB key, SHIFTTAB to press the SHIFT and TAB keys both at the same time, and ENT for the ENTER key. CURSORUP CURSORDOWN CURSORLEFT CURSO RRIGHT are shown as C.U C.D C.L and C.R; the number of key pressings of the cursor key are shown by the number - so one move up of the cursor is shown by C.U1, two by C.U2, etc. For clarity the entries are well spread and with line spacing; but they should be entered as a continuous sequence. <>pu<>pbINVESTMENT PORTFOLIO PROGRESS<>pb<>pu - from Jan. 1991 - all values in £'s. ENT ENT ENT Purchase data in first 4 columns. Value based on latest date prices. ENT ENT ENT ENT <>puInvestmentTAB<>w7ENT<>puDate TAB <>w7ENT<>puBoughtC.U1 C.L7Price C.D1 TAB <>w7ENT<>puNumberTAB <>w8ENT<>puCost TAB <>w8ENT<>puValueC.U1 C.L6CurrentC.D1 <>EAC (this adds a new column G to the right of F) <>w8ENT <>EAC (this adds a new column H to the right of G) <>w8ENT <>EAC (this adds a new column I to the right of H) <>w8ENT press SHIFTTAB twice, check cursor is in cell/slot G8 <>pu+/-%PC% C.U1 C.L5ProfitC.D1 TAB11-2-91 C.U1 C.L7LatestC.D1 TAB 1-2-91 C.U1 C.L6PricesC.D1 ENTENT C.L8(or press SHIFTTAB 8 times) <>puSharesENT ENT A ENT ENT B ENT ENT C ENT ENT <>puUnit TrustsENT ENT D ENT ENT E ENT ENT F ENT ENT TAB TAB TAB TAB-------TAB------- ENT C.L5(or press SHIFTTAB 5 times) TOTALS TAB TAB TAB TAB <>X SUM(E12 E26)ENT TAB <>X SUM(F12 F26)ENT C.U15(check cursor is in cell/slot F12) <>X D12*H12ENT <>BRE F12ENT F13 F25ENT SHIFTTAB (check cursor is in cell/slot E12) <>X C12*D12 <>BRE E12ENT E13 E25ENT TABTAB (check cursor is in cell/slot G12) <>X (F12-E12)/E12*100ENT (note - do not be anxious at the words Divide b in cell G12, the correct results will appear when you enter data in columns C D & H) <>LCT (this sets the default trailing character, ie the %PC% sign) <>BRE G12ENT G13 G27ENT (note, this is again the replicate process) C.L6 (or press SHIFTTAB 6 times) C.D15(or <>C.D to move cursor to the last line with the word TOTALS) ENT TAB TAB TAB TAB-------TAB------- The 'program' is now ready for you to enter data. To test - SHIFTTAB 5 times C.U16 (to cell/slot A12) TABJun '85TAB<>X 1.8ENT TAB<>X 200ENT TAB TAB TAB TAB<>X 2.46ENT TAB<>X 2.65ENT As you see, you have entered the data of share A (row 12) and your screen for this row should be identical to Figure 1. No doubt you will now wish to enter your own data; remember always to enter <>X before entering the numbers in columns C, D and H. %H1%Procedure to move old prices and enter latest prices into column H 1. Clear column I - 2. Move data from column H to I - 3. Enter your latest prices data into column H - 4. Alternative - to keep past prices - %CO:B,12,58% Move cursor to cell/slot I8 and 'mark' it by <>Z Move cursor to bottom of column I (by C.D17 or <>C.D) and 'mark' it by <>Z - the whole of column I from row 8 down should now be 'marked' in reverse 'white-on-black' format <>BD will now delete the contents Repeat the above process to 'mark' column H, that is - Move cursor to cell/slot H8 and 'mark' it by <>Z Move cursor to bottom of column H (by C.D17 or <>C.D) and 'mark' it by <>Z - the whole of column H from row 8 down should now be 'marked' in reverse 'white-on-black' format Move the cursor into top of column I by TAB C.U17 Copy column H into column I by <>BC Remove the 'marking' of column H by SHIFTTAB <>Q Go into 'overtype' mode by <>V Type the date in cell/slot H8 and the data in the other places as appropriate As an alternative it is possible to keep your past data on prices. In place of step 1 above, add a new column between columns H and I into which to move the data from column H - move the cursor into cell/slot I8 and insert the extra column by <>EIC. Then complete steps 2 and 3 as stated above. %CO:C,12,46% (note, this is the replicate process and the entries here are typed in response to the questions which appear in a box on the screen) (note, this is the replicate process as above) %CO:D,12,34% %CO:E,12,22% %CO:F,12,10%