| A | B | C | D | E | F | G | H | I | J | K | L | M |
| | | | | | | | | | | | | |
| | | | | | | | | | | | | |
| | | | | | Query Dates | | | | | | | |
Stock Name | Entry Date | Entry Price | Exit Date | # of Shares | | | | | | | | | |
ABC Co. | | | | | | | | | | | | | |
Ma & Pa Co. | | | | | | | | | | | | | |
XYZ Co. | | | | | | | | | | | | | |
Stardust Co. | | | | | | | | | | | | | |
New Co. | | | | | | | | | | | | | |
Startup Co. | | | | | | | | | | | | | |
Carparts Co. | | | | | | | | | | | | | |
Food Co. | | | * | | | | | | | | | | |
Mining Co. | | | | | | | | | | | | | |
| | | | | | | | | | | | | |
<tbody>
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=CACACA]#CACACA[/URL] , align: center"]1[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=CACACA]#CACACA[/URL] , align: center"]2[/TD]
[TD="align: center"]
$495.00
[/TD]
[TD="align: center"]
$505.00
[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=C0C0C0]#C0C0C0[/URL] , align: center"]RESULT OF QUERY[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=C0C0C0]#C0C0C0[/URL] , align: center"]RESULT OF QUERY[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=CACACA]#CACACA[/URL] , align: center"]3[/TD]
[TD="align: center"]Realized[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=FFFF00]#FFFF00[/URL] , align: center"]25-Aug-17[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=FFFF00]#FFFF00[/URL] , align: center"]30-Aug-17[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=C0C0C0]#C0C0C0[/URL] , align: center"]25-Aug-17[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=C0C0C0]#C0C0C0[/URL] , align: center"]30-Aug-17[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=CACACA]#CACACA[/URL] , align: center"]4[/TD]
[TD="align: center"]Profit[/TD]
[TD="align: center"]MTM PRICE[/TD]
[TD="align: center"]MTM PRICE[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=C0C0C0]#C0C0C0[/URL] "][/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=C0C0C0]#C0C0C0[/URL] "][/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=CACACA]#CACACA[/URL] , align: center"]5[/TD]
[TD="align: right"]9-Aug-17[/TD]
[TD="align: right"]$10.00[/TD]
[TD="align: right"]100[/TD]
[TD="align: right"] $ 11.00[/TD]
[TD="align: right"] $ 10.25[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=C0C0C0]#C0C0C0[/URL] , align: right"] $ 100.00[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=C0C0C0]#C0C0C0[/URL] , align: right"] $ 25.00[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=CACACA]#CACACA[/URL] , align: center"]6[/TD]
[TD="align: right"]10-Aug-17[/TD]
[TD="align: right"]$10.00[/TD]
[TD="align: right"]8/17/2017[/TD]
[TD="align: right"]100[/TD]
[TD="align: right"]10[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=C0C0C0]#C0C0C0[/URL] , align: right"] $ 10.00[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=C0C0C0]#C0C0C0[/URL] , align: right"] $ 10.00[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=CACACA]#CACACA[/URL] , align: center"]7[/TD]
[TD="align: right"]12-Aug-17[/TD]
[TD="align: right"]$10.00[/TD]
[TD="align: right"]100[/TD]
[TD="align: right"] $ 10.50[/TD]
[TD="align: right"] $ 11.00[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=C0C0C0]#C0C0C0[/URL] , align: right"] $ 50.00[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=C0C0C0]#C0C0C0[/URL] , align: right"] $ 100.00[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=CACACA]#CACACA[/URL] , align: center"]8[/TD]
[TD="align: right"]13-Aug-17[/TD]
[TD="align: right"]$10.00[/TD]
[TD="align: right"]100[/TD]
[TD="align: right"] $ 10.25[/TD]
[TD="align: right"] $ 11.25[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=C0C0C0]#C0C0C0[/URL] , align: right"] $ 25.00[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=C0C0C0]#C0C0C0[/URL] , align: right"] $ 125.00[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=CACACA]#CACACA[/URL] , align: center"]9[/TD]
[TD="align: right"]14-Aug-17[/TD]
[TD="align: right"]$10.00[/TD]
[TD="align: right"]8/25/2017[/TD]
[TD="align: right"]100[/TD]
[TD="align: right"]135[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=C0C0C0]#C0C0C0[/URL] , align: right"] $ 135.00[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=C0C0C0]#C0C0C0[/URL] , align: right"] $ 135.00[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=CACACA]#CACACA[/URL] , align: center"]10[/TD]
[TD="align: right"]15-Aug-17[/TD]
[TD="align: right"]$10.00[/TD]
[TD="align: right"]8/26/2017[/TD]
[TD="align: right"]100[/TD]
[TD="align: right"]60[/TD]
[TD="align: right"] $ 12.25[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=C0C0C0]#C0C0C0[/URL] , align: right"] $ 225.00[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=C0C0C0]#C0C0C0[/URL] , align: right"] $ 60.00[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=CACACA]#CACACA[/URL] , align: center"]11[/TD]
[TD="align: right"]16-Aug-17[/TD]
[TD="align: right"]$10.00[/TD]
[TD="align: right"]100[/TD]
[TD="align: right"]$ 9.00[/TD]
[TD="align: right"] $ 10.50[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=C0C0C0]#C0C0C0[/URL] , align: right"] $ (100.00)[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=C0C0C0]#C0C0C0[/URL] , align: right"] $ 50.00[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=CACACA]#CACACA[/URL] , align: center"]12[/TD]
[TD="align: right"]17-Aug-17[/TD]
[TD="align: right"]$10.00[/TD]
[TD="align: right"]8/28/2017[/TD]
[TD="align: right"]100[/TD]
[TD="align: right"]100[/TD]
[TD="align: right"] $ 10.50[/TD]
[TD="align: right"] $ 10.25[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=C0C0C0]#C0C0C0[/URL] , align: right"] $ 50.00[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=C0C0C0]#C0C0C0[/URL] , align: right"] $ 100.00[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=CACACA]#CACACA[/URL] , align: center"]13[/TD]
[TD="align: right"]30-Aug-17[/TD]
[TD="align: right"]$10.00[/TD]
[TD="align: right"]100[/TD]
[TD="align: right"] $ 9.00[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=C0C0C0]#C0C0C0[/URL] "][/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=C0C0C0]#C0C0C0[/URL] , align: right"] $ (100.00)[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=CACACA]#CACACA[/URL] , align: center"]14[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=C0C0C0]#C0C0C0[/URL] , align: right"]
$ 495.00
[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=C0C0C0]#C0C0C0[/URL] , align: right"]
$ 505.00
[/TD]
</tbody>
1.IF QUERY DATE => ENTRY DATE AND IF THE QUERY DATE IS<exit date="" or="" exit="" is="" blank,="" then="" calc="" the="" unrealized="" profit="" as="" of="" query="" by="" taking="" entry="" price="" and="" subtracting="" it="" from="" mtm="" (mark="" to="" market)="" multiply="" that="" sum="" #="" shares.="" return="" an="" error="" if="" blank.
< EXIT DATE OR EXIT DATE IS BLANK, THEN CALC THE UNREALIZED PROFIT AS OF THE QUERY DATE BY TAKING THE ENTRY PRICE AND SUBTRACTING IT FROM THE MTM (MARK TO MARKET) PRICE AND THEN MULTIPLY THAT SUM BY THE # OF SHARES. RETURN AN ERROR IF THE MTM PRICE IS BLANK.
2.IF QUERY DATE< ENTRY DATE THEN SKIP THOSE LINES.
1. IF QUERY DATE => ENTRY DATE AND IF THE QUERY DATE IS =>EXIT DATE, THEN PICKUP THE CORRESPONDING VALUES IN THE REALIZED PROFIT COLUMN AND SUM THOSE. (IN THIS CASE, NO NEED TO RETURN AN ERROR IF MTM PRICE IS BLANK WHICH IT MAY OR MAY NOT BE).
2. AGAIN, IF QUERY DATE< ENTRY DATE THEN SKIP THOSE LINES.