|
Result:
|
|
String - CSV
Syntax:
=CSV(Source, [ SourceType, Separator, Skip, SortByCol, SortMode
])
Note that this is an array function. First select a range of
cells to receive the output (e.g. 3 by 10 cells) Then enter the formula and
then press Ctrl+Shift+Enter in the formula editor.
Description:
Returns in separate cells the contents of a CSV
file, string or webpage. By creating the CSV function as array formula you can
receive multiple values from the source in separate cells.
Source: The source of the CSV
data. This can be a string, a file in which case you enter the full file path,
or a web page in which case you type the full url.
SourceType:
(default string) The type of data source. Set it to web or http for a web
page. Or set it to file to read the CSV data from a file
Separator :
(default ,) The delimiter character that separates the fields in the CSV
data.
Skip: Number of rows to skip.
SortByCol: One
column can be used to sort the csv data. Enter the column
number.
SortMode
: (default 0): 0 to sort ascending, 1 to sort
descending
Examples:
Display the contents of CSV data from the web:
Display the daily
data from the Dow Jones Industrial Average from 1/Dec/2008 to
1/Dec/2009
Select a block of cells (e.g. 10 rows and 7 columns), enter
the following formula and press
Alt-Enter
=csv("http://ichart.finance.yahoo.com/table.csv?s=^DJI&a=1&b=1&c=2000&d=1&e=1&f=2001&g=d&ignore=.csv","http")