# Importing data from Excel for DateListPlot

I am importing data from Excel and plotting it with DateListPlot. My code is

DateListPlot[{
Join @@ Import[""][[1 ;;, 3 ;;]][[All, All, 2 ;; 3]],
Join @@ Import[""][[1 ;;, 3 ;;]][[All, All, 4 ;; 5]]},
Joined -> True,
FrameTicks -> All]


But my problem is this works for just for the first sheet (year 2013) of the many in the same file. Sheet 2 is for Year 2012 and has the same format, and so forth. I want to get all the sheets for all the years; they are continuations of each other. Could you help me to figure out what code will do this?

-
offtop: 1;; = ;; = All – Kuba Jun 21 '13 at 10:42
@Kuba thanks can you see my coding skills?!!!! – Alex Jun 21 '13 at 10:47

This might work:

Import["test.xls", "Sheets"]


{Sheet1, Sheet2}

data1 = Import["test.xls", {"Sheets", "Sheet1"}];
data2 = Import["test.xls", {"Sheets", "Sheet2"}];
all = Sort[Join[data1, data2]];
DateListPlot[all, Joined -> True]


But I haven't got Excel here so I can't test it.

## Edit

With lots of sheets:

sheets = Import["test.xls", "Sheets"]
data  =  Import["test.xls", {"Sheets", # }] & /@ sheets


and see how the data looks then.

-
thanks but what if I have 50 sheets?Please pay attention to my required format of [[1 ;;, 3 ;;]][[All, All, 2 ;; 3]], [[1 ;;, 3 ;;]][[All, All, 4 ;; 5]] – Alex Jun 21 '13 at 10:37
@Alex No idea what all that means... :) But once you've imported the data, just select the bits you want - that should be basic list-manipulation stuff. – cormullion Jun 21 '13 at 10:58
It fails to import data what could be wrong? – Alex Jun 21 '13 at 11:18
I'm sorry, I'm not a doctor... :/ – cormullion Jun 21 '13 at 11:28
I am recovered :D thanks – Alex Jun 21 '13 at 12:13