Need help creating a 401k stock database in Excel.

Mr. Snrub

Board Regular
Joined
May 22, 2005
Messages
150
Office Version
  1. 365
Platform
  1. Windows
I am creating an Excel database of my 401k stock portfolio. I have the following tables (all formatted as Excel tables):

/* All the different stocks that are available to invest. */
Funds (stock_symbol, fund_name, fund_description)

/* Prices for each fund for every date since start of employment. */
SharePrices (share_price_date, stock_symbol, price_per_share)
Data Validation constraint: all values of stock_symbol must exist in Funds.

/* Three valid transaction_types:
share_purchase: purchase of shares of stock, usually happens once every pay period.
interfund_transfer: transfer of funds from one stock to another. requires
two transactions: one for selling the stocks, one for purchase the
equivalent amount of another stock.
fees: payment of fees is done by removing very small amounts of shares.
*/
TransactionTypes (transaction_type, transaction_type_description)

/* Two contribution accounts:
employee_contributions: Money I put into the database
employer_contributions: Money my employer matches.
*/
ContributionAccounts (contribution_account_name, contribution_account_description)

/* Shows all transactions (buying and selling of shares) that have occurred since start of employment */
ShareTransactions (transaction_date, transaction_type, contribution_account_name, stock_symbol, number_of_shares_bought_or_sold)
Data Validation constraint: all values of transaction_type must exist in TransactionTypes.
Data Validation constraint: all values of contribution_account_name must exist in ContributionAccounts.

/* The main table of the database. Displays the balance of an account for a stock fund on a certain date. */
ShareBalances(share_price_date, stock_symbol, share_price, contribution_account_name, balance_in_number_of_shares, balance_in_dollars)
Data Validation constraint: all values of stock_symbol must exist in Funds.
Data Validation constraint: all values of contribution_account_name must exist in ContributionAccounts.

So here is a sample of records in my ShareBalances table:

<table>
<tr>
<th>Date</th>
<th>Stock Symbol</th>
<th>Share Price</th>
<th>Contribution Account Name</th>
<th>Number of Shares</th>
<th>Amount</th>
</tr>
<tr>
<td>11/29/2018</td>
<td>vexrx</td>
<td>96.46</td>
<td>employee_contributions</td>
<td>173.995</td>
<td>$16,783.56</td>
</tr>
<tr>
<td>11/29/2018</td>
<td>vexrx</td>
<td>96.46</td>
<td>employer_contributions</td>
<td>165.029</td>
<td>$15,918.70</td>
</tr>
<tr>
<td>11/30/2018</td>
<td>vexrx</td>
<td>97.05</td>
<td>employee_contributions</td>
<td>173.995</td>
<td>$16,886.21</td>
</tr>
<tr>
<td>11/30/2018</td>
<td>vexrx</td>
<td>97.05</td>
<td>employer_contributions</td>
<td>165.029</td>
<td>$16,016.06</td>
</tr>
</table>

So now I have some questions:

I want to create an Excel chart that displays the daily balances of two series: employee_contributions and employer_contributions. How do I do that? Do I have to redo my ShareBalances table so that I add two columns: EmployeeContributionBalance and EmployerContributionBalance and get rid of Account, like so:

<table>
<tr>
<th>Date</th>
<th>Stock Symbol</th>
<th>Share Price</th>
<th>EmployeeContribution Share Balance</th>
<th>EmployerContribution Share Balance</th>
<th>EmployeeContribution Dollar Balance</th>
<th>EmployerContribution Dollar Balance</th>
</tr>
</table>

This would give me a way to create my chart, but it can't be right, though. I don't want to have to restructure the entire table if at some point in the future I have to add another account. What is the correct way to do this?

Also, I am open to any other ideas anyone might have on improving this thing. Can I implement a pivot table in some way?
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple

Forum statistics

Threads
1,223,888
Messages
6,175,207
Members
452,618
Latest member
Tam84

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