Jumat, 16 Agustus 2013

[smf_addin] Digest Number 2736

15 New Messages

Digest #2736
1a
RCHGetYahooQuotes returns 0 by "dennis071" dennis071
1b
Re: RCHGetYahooQuotes returns 0 by "Randy Harmelink" rharmelink
3b
3c
Re: RCHGetHTMLTable in excel macro..VBA by "Randy Harmelink" rharmelink
3f
Re: RCHGetHTMLTable in excel macro..VBA by "Randy Harmelink" rharmelink
4a
Gurufocus website by "amt2100" amt2100
4b
Re: Gurufocus website by "Randy Harmelink" rharmelink
4c
Re: Gurufocus website by "Jim Ranum" amt2100
4d
Re: Gurufocus website by "Randy Harmelink" rharmelink
4e
Re: Gurufocus website by "Jim Ranum" amt2100
4f
Re: Gurufocus website by "Randy Harmelink" rharmelink

Messages

Fri Aug 16, 2013 1:17 am (PDT) . Posted by:

"dennis071" dennis071

Hello,

I am having an issue obtaining the current price for India stocks using RCHGetYahooQuotes. Following is the formula I am using.
=RCHGetYahooQuotes("TATASTEEL.NS", "l1")

For US stocks it is working fine.
Apparently the csv file available for download at the Yahoo site is showing 0 as well, so I suspect it is an issue with the Yahoo site.

My question is whether is there another way to obtain the current price from the yahoo site?

Thanks in advance,
Dennis.

Fri Aug 16, 2013 1:34 am (PDT) . Posted by:

"Randy Harmelink" rharmelink

You can try either of:

=smfConvertData(smfGetTagContent("http://finance.yahoo.com/q?s=
"&D2,"span",0,"yfs_l84_"))
=smfConvertData(smfGetTagContent("http://finance.yahoo.com/q?s=
"&D2,"span",4,"rt_quote_summary"))

The problem is the coding of that section of the web page can change,
depending on whether it is pre-market, post-market, or while the market is
open. Plus, Yahoo seems to change it over time as well, so even when I have
it working consistently for the three situations, it stops working without
notice.

However, if you examine the source code of the web page, you should be able
to change your search strings in the above functions as needed.

On Fri, Aug 16, 2013 at 12:05 AM, dennis071 <dennis071@yahoo.com> wrote:

>
> I am having an issue obtaining the current price for India stocks using
> RCHGetYahooQuotes. Following is the formula I am using.
> =RCHGetYahooQuotes("TATASTEEL.NS", "l1")
>
> For US stocks it is working fine.
> Apparently the csv file available for download at the Yahoo site is
> showing 0 as well, so I suspect it is an issue with the Yahoo site.
>
> My question is whether is there another way to obtain the current price
> from the yahoo site?
>

Fri Aug 16, 2013 8:39 am (PDT) . Posted by:

"hscodes" hscodes

Hi,
I'd like to learn about your opinion for www.drstock.org website.
There is a free calculator to value the true stock prices on this website. I tried GE. It's current market price is now 24 USD. The calculator showed me the true value of GE stock is to be 24.37 USD. It seemed to me that system calculates the correct values. I tried for Johnson&Johnson. Calculator gave me 83.28USD as intrinsic value. The current market price is now 89.55 USD. But I checked from historical prices that this stock's lowest price was 66.86 USD.

Did anybody try this web site? It seemed to me that the calculations of the true values of the stocks are reliable. Can you share your calculations about GE and Johnson&Johnson stock prices?

Best regards,
M. Bumedien

Fri Aug 16, 2013 8:42 am (PDT) . Posted by:

"pragaon" pragaon

Hi,

This is more of a VBA macro question.

This formula is working fine to extract table from advfn site when i use it manually in excel.
###########
=RCHGetHTMLTable("http://ih.advfn.com/p.php?pid=financials&btn=istart_date&ctl00%24sb3%24tbq1=Get+Quote&as_values_IH=&ctl00%24sb3%24stb1=Search+iHub&mode=quarterly_reports&symbol="&A1&"%3A"&B1&"&istart_date=0", "INDICATORS&quot;,-1,"",1)
###########

Now i want to use it is Excel sheet with a macro. a1 and B1 cells have exchange and ticker typed in manually at this time. Macro is as below:

###########
' Start
Sub SMF_template_creater()
ChDir "C:\smf"

Workbooks.Open FileName:="C:\smf&#92;smf_all.xlsm"
Sheets("Template_Q").Select

Range("A1").Select
Range("A1").value = "Nasdaq"

Range("B1").Select
Range("B1").value = "AAPL"

Range("A2:F400").Select

Selection.FormulaArray = _
=RCHGetHTMLTable("http://ih.advfn.com/p.php?pid=financials&btn=istart_date&ctl00%24sb3%24tbq1=Get+Quote&as_values_IH=&ctl00%24sb3%24stb1=Search+iHub&mode=quarterly_reports&symbol="&A1&"%3A"&B1&"&istart_date=0", "INDICATORS&quot;,-1,"",1)

End Sub

###########

But the double quotes in the formula are messing it up.
any excel/VBA experts to fix it?

Thanks,
Prakash

Fri Aug 16, 2013 8:48 am (PDT) . Posted by:

"Nick Leaton" njleaton

Range("A1").Select
Range("A1").value = "Nasdaq"

is better writer as

Range("A1").value = "Nasdaq"

On 16 August 2013 16:42, pragaon <pragaon@yahoo.com> wrote:

> **
>
>
> Hi,
>
> This is more of a VBA macro question.
>
> This formula is working fine to extract table from advfn site when i use
> it manually in excel.
> ###########
> =RCHGetHTMLTable("
> http://ih.advfn.com/p.php?pid=financials&btn=istart_date&ctl00%24sb3%24tbq1=Get+Quote&as_values_IH=&ctl00%24sb3%24stb1=Search+iHub&mode=quarterly_reports&symbol="&A1&"%3A"&B1&"&istart_date=0",
> "INDICATORS&quot;,-1,"",1)
> ###########
>
> Now i want to use it is Excel sheet with a macro. a1 and B1 cells have
> exchange and ticker typed in manually at this time. Macro is as below:
>
> ###########
> ' Start
> Sub SMF_template_creater()
> ChDir "C:\smf"
>
> Workbooks.Open FileName:="C:\smf&#92;smf_all.xlsm"
> Sheets("Template_Q").Select
>
> Range("A1").Select
> Range("A1").value = "Nasdaq"
>
> Range("B1").Select
> Range("B1").value = "AAPL"
>
> Range("A2:F400").Select
>
> Selection.FormulaArray = _
> =RCHGetHTMLTable("
> http://ih.advfn.com/p.php?pid=financials&btn=istart_date&ctl00%24sb3%24tbq1=Get+Quote&as_values_IH=&ctl00%24sb3%24stb1=Search+iHub&mode=quarterly_reports&symbol="&A1&"%3A"&B1&"&istart_date=0",
> "INDICATORS&quot;,-1,"",1)
>
> End Sub
>
> ###########
>
> But the double quotes in the formula are messing it up.
> any excel/VBA experts to fix it?
>
> Thanks,
> Prakash
>
>
>

--
Nick

Fri Aug 16, 2013 8:56 am (PDT) . Posted by:

"Randy Harmelink" rharmelink

I see no value to doing something like this? What are you trying to do?
Just do it manually and it's done. Why bother with VBA?

In any case, I think the string in your function would be something like:

"
http://ih.advfn.com/p.php?pid=financials&btn=istart_date&mode=quarterly_reports&symbol=
""&A1&"":""&B1&""&istart_date=0"

On Fri, Aug 16, 2013 at 8:42 AM, pragaon <pragaon@yahoo.com> wrote:

> Hi,
>
> This is more of a VBA macro question.
>
> This formula is working fine to extract table from advfn site when i use
> it manually in excel.
> ###########
> =RCHGetHTMLTable("
> http://ih.advfn.com/p.php?pid=financials&btn=istart_date&ctl00%24sb3%24tbq1=Get+Quote&as_values_IH=&ctl00%24sb3%24stb1=Search+iHub&mode=quarterly_reports&symbol="&A1&"%3A"&B1&"&istart_date=0",
> "INDICATORS&quot;,-1,"",1)
> ###########
>
> Now i want to use it is Excel sheet with a macro. a1 and B1 cells have
> exchange and ticker typed in manually at this time. Macro is as below:
>
> ###########
> ' Start
> Sub SMF_template_creater()
> ChDir "C:\smf"
>
> Workbooks.Open FileName:="C:\smf&#92;smf_all.xlsm"
> Sheets("Template_Q").Select
>
> Range("A1").Select
> Range("A1").value = "Nasdaq"
>
> Range("B1").Select
> Range("B1").value = "AAPL"
>
> Range("A2:F400").Select
>
> Selection.FormulaArray = _
> =RCHGetHTMLTable("
> http://ih.advfn.com/p.php?pid=financials&btn=istart_date&ctl00%24sb3%24tbq1=Get+Quote&as_values_IH=&ctl00%24sb3%24stb1=Search+iHub&mode=quarterly_reports&symbol="&A1&"%3A"&B1&"&istart_date=0",
> "INDICATORS&quot;,-1,"",1)
>
> End Sub
>
> ###########
>
>
> But the double quotes in the formula are messing it up.
> any excel/VBA experts to fix it?
>

Fri Aug 16, 2013 9:07 am (PDT) . Posted by:

"pragaon" pragaon

I want to create a smf_all worksheet that will have several sheets
like aapl_Q, msft_Q,...etc.
Each sheet will contain fundamental data tables extracted from advfn sites.
one table occupies 6 columns and gives data for 5 quarters.
I can get data for several quarters in the same sheet(one sheet per ticker).

I want to pass on ticker and exchange value to the smf_all sheet via a macro and then create news sheets, extract data save data all using the macro.

once the macro is ready, I just have to run it on 2 columns of Exchange and Ticker.

-Prakash

--- In smf_addin@yahoogroups.com, Randy Harmelink <rharmelink@...> wrote:
>
> I see no value to doing something like this? What are you trying to do?
> Just do it manually and it's done. Why bother with VBA?
>
> In any case, I think the string in your function would be something like:
>
> "
> http://ih.advfn.com/p.php?pid=financials&btn=istart_date&mode=quarterly_reports&symbol=
> ""&A1&"":""&B1&""&istart_date=0"
>
> On Fri, Aug 16, 2013 at 8:42 AM, pragaon <pragaon@...> wrote:
>
> > Hi,
> >
> > This is more of a VBA macro question.
> >
> > This formula is working fine to extract table from advfn site when i use
> > it manually in excel.
> > ###########
> > =RCHGetHTMLTable("
> > http://ih.advfn.com/p.php?pid=financials&btn=istart_date&ctl00%24sb3%24tbq1=Get+Quote&as_values_IH=&ctl00%24sb3%24stb1=Search+iHub&mode=quarterly_reports&symbol="&A1&"%3A"&B1&"&istart_date=0",
> > "INDICATORS&quot;,-1,"",1)
> > ###########
> >
> > Now i want to use it is Excel sheet with a macro. a1 and B1 cells have
> > exchange and ticker typed in manually at this time. Macro is as below:
> >
> > ###########
> > ' Start
> > Sub SMF_template_creater()
> > ChDir "C:\smf"
> >
> > Workbooks.Open FileName:="C:\smf&#92;smf_all.xlsm"
> > Sheets("Template_Q").Select
> >
> > Range("A1").Select
> > Range("A1").value = "Nasdaq"
> >
> > Range("B1").Select
> > Range("B1").value = "AAPL"
> >
> > Range("A2:F400").Select
> >
> > Selection.FormulaArray = _
> > =RCHGetHTMLTable("
> > http://ih.advfn.com/p.php?pid=financials&btn=istart_date&ctl00%24sb3%24tbq1=Get+Quote&as_values_IH=&ctl00%24sb3%24stb1=Search+iHub&mode=quarterly_reports&symbol="&A1&"%3A"&B1&"&istart_date=0",
> > "INDICATORS&quot;,-1,"",1)
> >
> > End Sub
> >
> > ###########
> >
> >
> > But the double quotes in the formula are messing it up.
> > any excel/VBA experts to fix it?
> >
>

Fri Aug 16, 2013 9:17 am (PDT) . Posted by:

"pragaon" pragaon

Randy,
btw...your link does not work.

If i have to extract several quarters data of the same ticker, i have to use the link i used in my first email. Just changing start_date=0 to start_date=5 will give next 5 quarters data. and so on..

any idea how to parse my big link to excel formula?

thanks,
Prakash

--- In smf_addin@yahoogroups.com, Randy Harmelink <rharmelink@...> wrote:
>
> I see no value to doing something like this? What are you trying to do?
> Just do it manually and it's done. Why bother with VBA?
>
> In any case, I think the string in your function would be something like:
>
> "
> http://ih.advfn.com/p.php?pid=financials&btn=istart_date&mode=quarterly_reports&symbol=
> ""&A1&"":""&B1&""&istart_date=0"
>
> On Fri, Aug 16, 2013 at 8:42 AM, pragaon <pragaon@...> wrote:
>
> > Hi,
> >
> > This is more of a VBA macro question.
> >
> > This formula is working fine to extract table from advfn site when i use
> > it manually in excel.
> > ###########
> > =RCHGetHTMLTable("
> > http://ih.advfn.com/p.php?pid=financials&btn=istart_date&ctl00%24sb3%24tbq1=Get+Quote&as_values_IH=&ctl00%24sb3%24stb1=Search+iHub&mode=quarterly_reports&symbol="&A1&"%3A"&B1&"&istart_date=0",
> > "INDICATORS&quot;,-1,"",1)
> > ###########
> >
> > Now i want to use it is Excel sheet with a macro. a1 and B1 cells have
> > exchange and ticker typed in manually at this time. Macro is as below:
> >
> > ###########
> > ' Start
> > Sub SMF_template_creater()
> > ChDir "C:\smf"
> >
> > Workbooks.Open FileName:="C:\smf&#92;smf_all.xlsm"
> > Sheets("Template_Q").Select
> >
> > Range("A1").Select
> > Range("A1").value = "Nasdaq"
> >
> > Range("B1").Select
> > Range("B1").value = "AAPL"
> >
> > Range("A2:F400").Select
> >
> > Selection.FormulaArray = _
> > =RCHGetHTMLTable("
> > http://ih.advfn.com/p.php?pid=financials&btn=istart_date&ctl00%24sb3%24tbq1=Get+Quote&as_values_IH=&ctl00%24sb3%24stb1=Search+iHub&mode=quarterly_reports&symbol="&A1&"%3A"&B1&"&istart_date=0",
> > "INDICATORS&quot;,-1,"",1)
> >
> > End Sub
> >
> > ###########
> >
> >
> > But the double quotes in the formula are messing it up.
> > any excel/VBA experts to fix it?
> >
>

Fri Aug 16, 2013 9:27 am (PDT) . Posted by:

"Randy Harmelink" rharmelink

Why do you even need the cell references? Just hard-code the things you
already have.

On Fri, Aug 16, 2013 at 9:17 AM, pragaon <pragaon@yahoo.com> wrote:

> Randy,
> btw...your link does not work.
>
> If i have to extract several quarters data of the same ticker, i have to
> use the link i used in my first email. Just changing start_date=0 to
> start_date=5 will give next 5 quarters data. and so on..
>
> any idea how to parse my big link to excel formula?
>

Fri Aug 16, 2013 4:29 pm (PDT) . Posted by:

"amt2100" amt2100

Hi Randy,

Long time lurker/wannabe here. I have looked through everything in the files section, downloaded and tried to use some things, but I just don't get what I'm looking at with this stuff.
A couple questions:

Where can I find a layout and explanation of what you're supposed to type into a cell after the RCHGetTableCell or any of your other commands? I see these long strings inside the parenthesis, but I don't see anywhere to get what is what or what comes next.
Sorry for the back to 1st grade thing, but I don't know where to start on this.

Second question is, I would like to extract maybe 3 or 4 particular bits of info from gurufocus.com and I see you even have a file for gurufocus in the files section, but when I load it up, no data populates the cells. There's no errors at least, but just a couple dashes in the cells is all that shows up.

I'd like to pull the data off the 10yr Financials page of gurufocus, just a couple things like Total Equity and Free Cash Flow, but how do you know what "field" to call it?

Thanks for any assistance,
Jim

Fri Aug 16, 2013 5:10 pm (PDT) . Posted by:

"Randy Harmelink" rharmelink

Have you seen the documentation for the functions in the "Documentation"
folder of the FILES area of the group? Is that what you're asking for, or
are you asking for more detailed information?

The two specific things you asked about would be:

=RCHGetTableCell("http://www.gurufocus.com/financials/MMM",1,">Fiscal
Period",">Total Equity")
=RCHGetTableCell("http://www.gurufocus.com/financials/MMM",1,">Fiscal
Period",">Free Cash Flow")

Just vary the 1 from 1 to 16 for the various columns available.

On Fri, Aug 16, 2013 at 4:29 PM, amt2100 <amt2100@gmail.com> wrote:

> Hi Randy,
>
> Long time lurker/wannabe here. I have looked through everything in the
> files section, downloaded and tried to use some things, but I just don't
> get what I'm looking at with this stuff.
> A couple questions:
>
> Where can I find a layout and explanation of what you're supposed to type
> into a cell after the RCHGetTableCell or any of your other commands? I see
> these long strings inside the parenthesis, but I don't see anywhere to get
> what is what or what comes next.
> Sorry for the back to 1st grade thing, but I don't know where to start on
> this.
>
> Second question is, I would like to extract maybe 3 or 4 particular bits
> of info from gurufocus.com and I see you even have a file for gurufocus
> in the files section, but when I load it up, no data populates the cells.
> There's no errors at least, but just a couple dashes in the cells is all
> that shows up.
>
> I'd like to pull the data off the 10yr Financials page of gurufocus, just
> a couple things like Total Equity and Free Cash Flow, but how do you know
> what "field" to call it?
>

Fri Aug 16, 2013 6:18 pm (PDT) . Posted by:

"Jim Ranum" amt2100

Hi Randy,

First of all, awesome.

Secondly, why yes I did look at all those files. But I think you have been using this stuff for so long, you can't imagine what it's like to not know anything about it.

I didn't know which function to use for this case.

I still would have gotten it wrong, because the way I read the Documentation for RCHGetTableCell is after the URL and Cell#, it says Find1, etc. and:

1. I wouldn't have known to put a ">" in front of the string value

2. I wouldn't have known to even put the quotation marks around the string with the > in front of it

3. I would have been scratching my head trying to figure out how the "Row#" factors into it, which was irrelevant based on your solution below

So in essence, there was not a snowballs chance in hell I would have figured this out, with the documentation.

All that said, I copy and pasted your solutions in my spreadsheet and it worked instantly! You are obviously a genius with this stuff.

Speaking for the mere mortals out here, I thank you humbly and profusely!

I have one last question about this, if you'd be so kind. I would like to paste my list of tickers in a column and then have these instructions below in another column and have them just adjust to the new ticker as I update them in column A, instead of my going through each cell and changing the ticker in the formula (in your example MMM). I've tried inserting the logical things like "=A4", etc. in place of MMM, but it doesn't work. How do you do that? My tickers will be down the "A" column in the spreadsheet with your functions in other columns farther down with other data in between.

Thanks again, very much,

Jim

From: smf_addin@yahoogroups.com [mailto:smf_addin@yahoogroups.com] On Behalf Of Randy Harmelink
Sent: Friday, August 16, 2013 8:11 PM
To: smf_addin@yahoogroups.com
Subject: Re: [smf_addin] Gurufocus website

Have you seen the documentation for the functions in the "Documentation" folder of the FILES area of the group? Is that what you're asking for, or are you asking for more detailed information?

The two specific things you asked about would be:

=RCHGetTableCell("http://www.gurufocus.com/financials/MMM",1,">Fiscal Period",">Total Equity")
=RCHGetTableCell("http://www.gurufocus.com/financials/MMM",1,">Fiscal Period",">Free Cash Flow")

Just vary the 1 from 1 to 16 for the various columns available.

On Fri, Aug 16, 2013 at 4:29 PM, amt2100 <amt2100@gmail.com> wrote:

Hi Randy,

Long time lurker/wannabe here. I have looked through everything in the files section, downloaded and tried to use some things, but I just don't get what I'm looking at with this stuff.
A couple questions:

Where can I find a layout and explanation of what you're supposed to type into a cell after the RCHGetTableCell or any of your other commands? I see these long strings inside the parenthesis, but I don't see anywhere to get what is what or what comes next.
Sorry for the back to 1st grade thing, but I don't know where to start on this.

Second question is, I would like to extract maybe 3 or 4 particular bits of info from gurufocus.com and I see you even have a file for gurufocus in the files section, but when I load it up, no data populates the cells. There's no errors at least, but just a couple dashes in the cells is all that shows up.

I'd like to pull the data off the 10yr Financials page of gurufocus, just a couple things like Total Equity and Free Cash Flow, but how do you know what "field" to call it?

Fri Aug 16, 2013 7:15 pm (PDT) . Posted by:

"Randy Harmelink" rharmelink

On Fri, Aug 16, 2013 at 6:18 PM, Jim Ranum <amt2100@gmail.com> wrote:
> Secondly, why yes I did look at all those files. But I think you have
been using this stuff for so long, you can't imagine
> what it's like to not know anything about it.

No doubt.

OTOH, the way I first learned how to program was to take IBM's BASIC
Reference Manual and BASIC Programmer&#39;s Guide home, and read them cover to
cover before I even tried to program anything.

> I didn't know which function to use for this case.

There are a lot more than there used to be. My problem is -- the more
documentation I write up to try and make it more clear, the less likely
people are to even read it.

It's one reason I always have examples in the documentation. An example can
help to show how everything interconnects.

> I still would have gotten it wrong, because the way I read the
Documentation for RCHGetTableCell is after the URL
> and Cell#, it says Find1, etc. and:

Many of which are optional and have default values. If you had coded every
parameter, the function would have looked like:

=RCHGetTableCell("http://www.gurufocus.com/financials/MMM",1,">Fiscal
Period",">Total Equity"," "," ",0,"</body",0,"Error",0)

> 1. I wouldn't have known to put a ">" in front of the string value

The only reason I did is because I looked at the source code of the web
page. Coming up with unique search strings can be especially challenging.

> 2. I wouldn't have known to even put the quotation marks around the
string with the > in front of it

That's just the normal EXCEL way to specify a text string.

> 3. I would have been scratching my head trying to figure out how
the "Row#" factors into it, which was irrelevant
> based on your solution below

Which is why the documentation says optional. You can code a zero if you'd
like. You just got the default value.

> So in essence, there was not a snowballs chance in hell I would have
figured this out, with the documentation.

What would have helped you figure it out? Did you walk through the
examples, to see what the parameters were doing in the function?

> All that said, I copy and pasted your solutions in my spreadsheet and it
worked instantly! You are obviously a genius
> with this stuff.

Just a lot of practice. The function actually came about because I was
doing it all manually and noticed that the pattern was pretty much the same
behind each extraction. So, just create a function and pass the parameters
that make each extraction unique.

I used to copy and paste the code, and then manually change each of those
items that made the extractions unique.

That's also why the default parameter values are what they are. In most
cases, the parameters with default values don't need to be used, unless
special processing is required.

> I have one last question about this, if you'd be so kind. I would like to
paste my list of tickers in a column and then have
> these instructions below in another column and have them just adjust to
the new ticker as I update them in column A,
> instead of my going through each cell and changing the ticker in the
formula (in your example MMM). I've tried inserting
> the logical things like "=A4", etc. in place of MMM, but it doesn't work.
How do you do that? My tickers will be down the
> "A" column in the spreadsheet with your functions in other columns
farther down with other data in between.

Just use the normal EXCEL concatenation string operation:

=RCHGetTableCell("http://www.gurufocus.com/financials/"&A4,1,">Fiscal
Period",">Total Equity")

Fri Aug 16, 2013 7:37 pm (PDT) . Posted by:

"Jim Ranum" amt2100

I can't tell you what a huge help this is!

That little thing with the Just use the normal EXCEL concatenation string operation:

Was kicking my ass. And I use Excel every day, for a ton of different things. That actually is going to solve multiple things I have been doing. What a relief. And I couldn't find how to do this looking on dozens of websites.

Thanks also for the book references. I really didn't know where to start.

Awesome, really.

Thanks again,

Jim

From: smf_addin@yahoogroups.com [mailto:smf_addin@yahoogroups.com] On Behalf Of Randy Harmelink
Sent: Friday, August 16, 2013 10:15 PM
To: smf_addin@yahoogroups.com
Subject: Re: [smf_addin] Gurufocus website

On Fri, Aug 16, 2013 at 6:18 PM, Jim Ranum <amt2100@gmail.com> wrote:
> Secondly, why yes I did look at all those files. But I think you have been using this stuff for so long, you can't imagine
> what it's like to not know anything about it.

No doubt.

OTOH, the way I first learned how to program was to take IBM's BASIC Reference Manual and BASIC Programmer&#39;s Guide home, and read them cover to cover before I even tried to program anything.

> I didn't know which function to use for this case.

There are a lot more than there used to be. My problem is -- the more documentation I write up to try and make it more clear, the less likely people are to even read it.

It's one reason I always have examples in the documentation. An example can help to show how everything interconnects.

> I still would have gotten it wrong, because the way I read the Documentation for RCHGetTableCell is after the URL
> and Cell#, it says Find1, etc. and:

Many of which are optional and have default values. If you had coded every parameter, the function would have looked like:

=RCHGetTableCell("http://www.gurufocus.com/financials/MMM",1,">Fiscal Period",">Total Equity"," "," ",0,"</body",0,"Error",0)

> 1. I wouldn't have known to put a ">" in front of the string value

The only reason I did is because I looked at the source code of the web page. Coming up with unique search strings can be especially challenging.

> 2. I wouldn't have known to even put the quotation marks around the string with the > in front of it

That's just the normal EXCEL way to specify a text string.

> 3. I would have been scratching my head trying to figure out how the "Row#" factors into it, which was irrelevant
> based on your solution below

Which is why the documentation says optional. You can code a zero if you'd like. You just got the default value.

> So in essence, there was not a snowballs chance in hell I would have figured this out, with the documentation.

What would have helped you figure it out? Did you walk through the examples, to see what the parameters were doing in the function?

> All that said, I copy and pasted your solutions in my spreadsheet and it worked instantly! You are obviously a genius
> with this stuff.

Just a lot of practice. The function actually came about because I was doing it all manually and noticed that the pattern was pretty much the same behind each extraction. So, just create a function and pass the parameters that make each extraction unique.

I used to copy and paste the code, and then manually change each of those items that made the extractions unique.

That's also why the default parameter values are what they are. In most cases, the parameters with default values don't need to be used, unless special processing is required.

> I have one last question about this, if you'd be so kind. I would like to paste my list of tickers in a column and then have
> these instructions below in another column and have them just adjust to the new ticker as I update them in column A,
> instead of my going through each cell and changing the ticker in the formula (in your example MMM). I've tried inserting
> the logical things like "=A4", etc. in place of MMM, but it doesn't work. How do you do that? My tickers will be down the
> "A" column in the spreadsheet with your functions in other columns farther down with other data in between.

Just use the normal EXCEL concatenation string operation:

=RCHGetTableCell("http://www.gurufocus.com/financials/"&A4,1,">Fiscal Period",">Total Equity")

Fri Aug 16, 2013 7:48 pm (PDT) . Posted by:

"Randy Harmelink" rharmelink

Those weren't recommendations. Just how I started in programming. But that
was nearly 50 years ago...back when I was using a teletype machine with
paper tape storage, using a 300 baud modem in the office next to the
principal. Whenever he got a phone call, the modem would disconnect.

Today, learning programming? Google is your friend. But I'm a trial and
error type guy. I think making mistakes helps you learn more of the ins and
outs than doing it right the first time. :)

On Fri, Aug 16, 2013 at 7:37 PM, Jim Ranum <amt2100@gmail.com> wrote:

> Thanks also for the book references. I really didn't know where to start.
>
>
>

Tidak ada komentar:

Posting Komentar