Instead of searching for the NAVs of all my funds at MyIRIS or MutualFundsIndia, I have developed a small excel sheet which will fetch the values for me and displays the current portfolio value at the click of a button. Here I am trying to share the “HOWTO” of the same.
- Create an excel workbook with 2 sheets. Call one as “NAVs” and the other as “Portfolio”.
- In the NAVs sheet, click at one of the top-left cells (I did on A2), and go to Data -> Import External Data -> New Web Query. [For more information on using Web Queries, visit Using Web Queries to Import Data to Excel @ R1C1.
- Now paste the url http://finance.indiamart.com/markets/mutual_funds/latest_mf_navs.html in Address box and press go. You would see something like this.
Say “Import”. Essentially what you have done is, creating an automatically updatable NAV list in the NAVs sheet. - Now select all Schemes in the imported table and define a named range as “fund_names” for it. [Creating Named Ranges in Excel]
- Now, go to “Portfolio” sheet and create a table like this.
[Click on it to Zoom] - Next select the Fundname column (I have 32 rows, you can have as many as you wish) and go to Data->Validation. Enter the settings like this.
- Formulas:
>>> For Purchase Value[f3]: “=e3*d3”
>>> For Current Value[h3]: “=g3*d3”
>>> For Current NAV[g3]: “=IF(C3=””,0,VLOOKUP(C3,NAVs!$A$6:$D$1634,3,FALSE))”
essentially, looking up for the selected fund name in the NAVs sheet and returning the exact NAV to this cell only if a fund name is selected.
>>> Gain / Loss[i3]: “=IF(ISERROR((H3-F3)/F3),””,(H3-F3)/F3)”
to avoid DIV 0 messages. - At the end of the table you can add a TOTAL row and repeat the necessary formulas to get the total portfolio performance.
- Now the portfolio tracker is done. Enter the fund data by selecting the fund name from drop down and number of units purchased, purchase NAV. Rest will be shown by the tracker.
- Remember: everytime you open the workbook, go to “NAVs” sheet and refresh the data. [Select anywhere in the table, right click and say Refresh Data]
Now this is a very basic portfolio tracker. I am thinking of adding some VBA / Macro so that everytime the table is refreshed, the new values are written in a separate sheet called “Historical NAV” so that we can track the fund performance over a period of time by selecting a date (instead of current date). Also, if we can import benchmark indices on runtime, you can get relative performance metrics. Plus, some more analysis of fund performances (instead of mere total return) would reveal the risk-returns of the portfolio. Lets see if I can build such a thing in my spare time.
[Just in case you do not have time for all this, then you can access the workbook that I have created here: Portfolio Manager MFs India ]














13 Responses to “Data Validation using an Unsorted column with Duplicate Entries as a Source List”
Pivot Table will involve manual intervention; hence I prefer to use the 'countif remove duplicate trick' along with 'text sorting formula trick; then using the offset with len to name the final range for validation.
if using the pivot table, set the sort to Ascending, so the list in the validation cell comes back alphabetically.
Hui: Brillant neat idea.
Vipul: I am intrigued by what you are saying. Please is it possible to show us how it can be done, because as u said Hui's method requires user intervention.
Thks to PHD and all
K
Table names dont work directly inside Data validation.
You will have to define a name and point it to the table name and then use the name inside validation
Eg MyClient : Refers to :=Table1[Client]
And then in the list validation say = MyClient
Kieranz,
Pls download the sample here http://cid-e98339d969073094.skydrive.live.com/self.aspx/.Public/data-validation-unsorted-list-example.xls
Off course there are many other ways of doing the same and integrating the formulae in multiple columns into one.
Pls refer to column FGHI in that file. Cell G4 is where my validation is.
Vipul:
Many thks, will study it latter.
Rgds
K
[...] to chandoo for the idea of getting unique list using Pivot tables. What we do is that create a pivot table [...]
@Vipul:
Thanks, that was awesome! 🙂
@Playercharlie Happy to hear that 🙂
Great contribution, Hui. Solved a problem of many years!
Thanks to you, A LOT
Hi Hui,
Greeting
hope you are doing well.
I'm interested to send you a private vba excel file which i need to show detail of pivot in new workbook instead of showing in same workbook as new sheet.
Please contact me on muhammed.ye@gmail.com
Best Regards