value of a CUSIP number in GoogleDocs?

Discussion of the Bond portion of the Permanent Portfolio

Moderator: Global Moderator

Post Reply
patrickjhall

value of a CUSIP number in GoogleDocs?

Post 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
User avatar
dualstow
Executive Member
Executive Member
Posts: 14281
Joined: Wed Oct 27, 2010 10:18 am
Location: synagogue of Satan
Contact:

Re: value of a CUSIP number in GoogleDocs?

Post by dualstow »

Perhaps not, but if you haven't seen this page,
scroll or search for "fnord123's method"
🍍
rickb
Executive Member
Executive Member
Posts: 762
Joined: Mon Apr 26, 2010 12:12 am

Re: value of a CUSIP number in GoogleDocs?

Post by rickb »

User avatar
melveyr
Executive Member
Executive Member
Posts: 971
Joined: Mon Jun 28, 2010 3:30 pm
Location: Seattle, WA
Contact:

Re: value of a CUSIP number in GoogleDocs?

Post by melveyr »

Value of a bond by CUSIP?

Done.

https://docs.google.com/spreadsheet/ccc ... CQ3c#gid=0

;D

Let me know if you have any questions.
everything comes from somewhere and everything goes somewhere
SteveGo
Full Member
Full Member
Posts: 82
Joined: Sun May 22, 2011 12:59 pm
Location: Texas

Re: value of a CUSIP number in GoogleDocs?

Post 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
melveyr wrote: Value of a bond by CUSIP?

Done.

https://docs.google.com/spreadsheet/ccc ... CQ3c#gid=0

;D

Let me know if you have any questions.
Steve G
User avatar
Tortoise
Executive Member
Executive Member
Posts: 2751
Joined: Sat Nov 06, 2010 2:35 am

Re: value of a CUSIP number in GoogleDocs?

Post by Tortoise »

Slick, melveyr!
patrickjhall

Re: value of a CUSIP number in GoogleDocs?

Post by patrickjhall »

melveyr wrote: Value of a bond by CUSIP?

Done.
Brilliant! Thank you!
User avatar
dualstow
Executive Member
Executive Member
Posts: 14281
Joined: Wed Oct 27, 2010 10:18 am
Location: synagogue of Satan
Contact:

Re: value of a CUSIP number in GoogleDocs?

Post 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. ???
🍍
SteveGo
Full Member
Full Member
Posts: 82
Joined: Sun May 22, 2011 12:59 pm
Location: Texas

Re: value of a CUSIP number in GoogleDocs?

Post by SteveGo »

Fidelity values your holdings using the "Third Party" price, not the bid or ask.
Steve G
User avatar
dualstow
Executive Member
Executive Member
Posts: 14281
Joined: Wed Oct 27, 2010 10:18 am
Location: synagogue of Satan
Contact:

Re: value of a CUSIP number in GoogleDocs?

Post by dualstow »

SteveGo wrote: Fidelity values your holdings using the "Third Party" price, not the bid or ask.
ah, thanks.
🍍
User avatar
melveyr
Executive Member
Executive Member
Posts: 971
Joined: Mon Jun 28, 2010 3:30 pm
Location: Seattle, WA
Contact:

Re: value of a CUSIP number in GoogleDocs?

Post 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
everything comes from somewhere and everything goes somewhere
flyingpylon
Executive Member
Executive Member
Posts: 1102
Joined: Fri Jan 06, 2012 9:04 am

Re: value of a CUSIP number in GoogleDocs?

Post 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.
Last edited by flyingpylon on Wed Mar 21, 2012 12:06 pm, edited 1 time in total.
User avatar
Storm
Executive Member
Executive Member
Posts: 1652
Joined: Tue Aug 24, 2010 1:04 pm

Re: value of a CUSIP number in GoogleDocs?

Post 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?
"I came here for financial advice, but I've ended up with a bunch of shave soaps and apparently am about to start eating sardines.  Not that I'm complaining, of course." -ZedThou
flyingpylon
Executive Member
Executive Member
Posts: 1102
Joined: Fri Jan 06, 2012 9:04 am

Re: value of a CUSIP number in GoogleDocs?

Post 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.
User avatar
Storm
Executive Member
Executive Member
Posts: 1652
Joined: Tue Aug 24, 2010 1:04 pm

Re: value of a CUSIP number in GoogleDocs?

Post 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!
"I came here for financial advice, but I've ended up with a bunch of shave soaps and apparently am about to start eating sardines.  Not that I'm complaining, of course." -ZedThou
User avatar
dualstow
Executive Member
Executive Member
Posts: 14281
Joined: Wed Oct 27, 2010 10:18 am
Location: synagogue of Satan
Contact:

Re: value of a CUSIP number in GoogleDocs?

Post by dualstow »

Works great, thank you!
🍍
flyingpylon
Executive Member
Executive Member
Posts: 1102
Joined: Fri Jan 06, 2012 9:04 am

Re: value of a CUSIP number in GoogleDocs?

Post 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.
User avatar
Lone Wolf
Executive Member
Executive Member
Posts: 1416
Joined: Wed Aug 11, 2010 11:15 pm

Re: value of a CUSIP number in GoogleDocs?

Post by Lone Wolf »

flyingpylon wrote: 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)
Very nice!  It looks like this works great.  Thanks, everyone!
User avatar
foglifter
Executive Member
Executive Member
Posts: 634
Joined: Tue Apr 27, 2010 5:37 pm
Location: The Golden State

Re: value of a CUSIP number in GoogleDocs?

Post 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.
"Let every man divide his money into three parts, and invest a third in land, a third in business, and a third let him keep in reserve."
- Talmud
User avatar
foglifter
Executive Member
Executive Member
Posts: 634
Joined: Tue Apr 27, 2010 5:37 pm
Location: The Golden State

Re: value of a CUSIP number in GoogleDocs?

Post 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.
"Let every man divide his money into three parts, and invest a third in land, a third in business, and a third let him keep in reserve."
- Talmud
Post Reply