Page 1 of 1
value of a CUSIP number in GoogleDocs?
Posted: Mon Jan 16, 2012 8:45 am
by patrickjhall
Has anyone figured out a reliable way of pulling in specific LTT treasure values, by CUSIP number, real-time into GoogleDocs?
Many thanks
Re: value of a CUSIP number in GoogleDocs?
Posted: Fri Jan 20, 2012 2:43 pm
by dualstow
Perhaps not, but if you haven't seen
this page,
scroll or search for "fnord123's method"
Re: value of a CUSIP number in GoogleDocs?
Posted: Sat Jan 21, 2012 1:02 am
by rickb
Re: value of a CUSIP number in GoogleDocs?
Posted: Sat Jan 21, 2012 10:57 am
by melveyr
Value of a bond by CUSIP?
Done.
https://docs.google.com/spreadsheet/ccc ... CQ3c#gid=0
Let me know if you have any questions.
Re: value of a CUSIP number in GoogleDocs?
Posted: Sat Jan 21, 2012 3:37 pm
by SteveGo
Thanks for that. Just put it into my spreadsheet. Works great. I decided to use the "third party price," since that is what Fidelity uses to value the Treasuries in my account there.
Guess I did not know you could get those Bond quotes without being logged in.
+1 to melveyr
Re: value of a CUSIP number in GoogleDocs?
Posted: Sat Jan 21, 2012 4:56 pm
by Tortoise
Slick, melveyr!
Re: value of a CUSIP number in GoogleDocs?
Posted: Sun Jan 22, 2012 6:21 pm
by patrickjhall
melveyr wrote:
Value of a bond by CUSIP?
Done.
Brilliant! Thank you!
Re: value of a CUSIP number in GoogleDocs?
Posted: Sat Jan 28, 2012 6:55 am
by dualstow
Are you getting slightly different values in google docs and in fidelity itself?
For example, for CUSIP 912810QL5 I get 123.812 in g-docs but 123.719 in fidelity (in my actual holdings).
Perhaps one is one day out of date? But I think the previous price was 123.094.

Re: value of a CUSIP number in GoogleDocs?
Posted: Sat Jan 28, 2012 7:23 am
by SteveGo
Fidelity values your holdings using the "Third Party" price, not the bid or ask.
Re: value of a CUSIP number in GoogleDocs?
Posted: Sat Jan 28, 2012 7:27 am
by dualstow
SteveGo wrote:
Fidelity values your holdings using the "Third Party" price, not the bid or ask.
ah, thanks.
Re: value of a CUSIP number in GoogleDocs?
Posted: Sat Jan 28, 2012 10:10 am
by melveyr
I added the bond description, third party price, and the YTM. Please copy over to your spreadsheets if you would like. :)
https://docs.google.com/spreadsheet/ccc ... CQ3c#gid=0
Re: value of a CUSIP number in GoogleDocs?
Posted: Wed Mar 21, 2012 10:22 am
by flyingpylon
It looks like Fidelity has changed the page that displays bond prices.
I updated the cell in my Google Spreadsheet that displays the price to this:
=index(ImportHtml("
http://fixedincome.fidelity.com/fi/FIBo ... USIP",1,10),5,2)
You'll need to replace CUSIP with the actual CUSIP number surrounded by quotes or alternatively, a cell reference without the quotes. For example, my formula replaces "CUSIP" with $B3 like this:
=index(ImportHtml("
http://fixedincome.fidelity.com/fi/FIBo ... "&$B3,1,10),5,2)
If you're putting the CUSIP directly into the formula, you could also put it directly after the = and before the " and then remove the &"CUSIP" entirely. The & just concatenates the two values. So it would look like this:
=index(ImportHtml("
http://fixedincome.fidelity.com/fi/FIBo ... USIP",1,10),5,2)
The value returned is the third party price. If you'd prefer the bid price, change the 5 to a 1, or for the ask price change the 5 to a 2.
Melveyr's spreadsheet mentioned above doesn't appear to list bond prices anymore.
Re: value of a CUSIP number in GoogleDocs?
Posted: Wed Mar 21, 2012 11:39 am
by Storm
flyingpylon wrote:
It looks like Fidelity has changed the page that displays bond prices.
I updated the cell in my Google Spreadsheet that displays the price to this:
=index(ImportHtml("
http://fixedincome.fidelity.com/fi/FIBo ... CUSIP,1,10),5,2)
You'll need to replace CUSIP with the actual CUSIP number or a cell reference (for example, mine references $B3).
The value returned is the third party price. If you'd prefer the bid price, change the 5 to a 1, or for the ask price change the 5 to a 2.
Melveyr's spreadsheet mentioned above doesn't appear to list bond prices anymore.
Thanks, melveyr's spreadsheet has changed, as you mentioned, and no longer contains bonds. Your formula still isn't working correctly for me. I get a parse error when I try;
=index(ImportHtml("
http://fixedincome.fidelity.com/fi/FIBo ... 10QD3,1,10),5,2)
Any ideas what I'm doing wrong?
Re: value of a CUSIP number in GoogleDocs?
Posted: Wed Mar 21, 2012 12:03 pm
by flyingpylon
Yes, you followed my incorrect instructions!

Sorry about that. I have fixed it.
The problem was that you did not have quotation marks around the CUSIP number.
Re: value of a CUSIP number in GoogleDocs?
Posted: Wed Mar 21, 2012 2:17 pm
by Storm
flyingpylon wrote:
Yes, you followed my incorrect instructions!

Sorry about that. I have fixed it.
The problem was that you did not have quotation marks around the CUSIP number.
Thanks! My spreadsheet is finally automatically updating bond prices. This is awesome!
Re: value of a CUSIP number in GoogleDocs?
Posted: Wed Mar 21, 2012 10:08 pm
by dualstow
Works great, thank you!
Re: value of a CUSIP number in GoogleDocs?
Posted: Thu Mar 22, 2012 9:04 am
by flyingpylon
Just for future reference, in case Fidelity changes the page again and it breaks your spreadsheet formula, here is what the formula does:
=index(ImportHtml("
http://fixedincome.fidelity.com/fi/FIBo ... USIP",1,10),5,2)
The ImportHtml function gets the page at that url and looks in the html code for tables (indicated by the 1 but you could also use the word "table" including the quotes).
The 10 tells ImportHtml to import the 10th table in the html code (you can find this by doing "view source" on the page and searching for the string "<table" until you come to the right one).
The Index function retrieves the value in the 5th row (indicated by the 5) and 2nd cell (indicated by the 2) of the imported table. In html tables, rows are wrapped with <tr> tags and cells with <th> or <td> tags.
Re: value of a CUSIP number in GoogleDocs?
Posted: Thu Mar 22, 2012 9:26 am
by Lone Wolf
Very nice! It looks like this works great. Thanks, everyone!
Re: value of a CUSIP number in GoogleDocs?
Posted: Fri Mar 23, 2012 3:18 pm
by foglifter
To ensure this valuable technique is easy to find I've posted a screenshot and a brief explanation into the bond buying tutorial.
Re: value of a CUSIP number in GoogleDocs?
Posted: Mon Apr 09, 2012 7:39 pm
by foglifter
It appears that Fidelity has changed the URL for the bond details page. I have updated the Google Docs formula in my post in the
Treasury Bond Buying Tutorial.