Dear all,
I have different excel files stored as “xlsx files”. These files have the same structure as below.
The files are named an identifier (ISIN), followed by “_1”. There also files with identifiers and stored with _2 _3 _4, but I don’t have to consider them. All the files are in a specific pathfolder.
What I need to do is the following.

I have different excel files stored as “xlsx files”. These files have the same structure as below.
The files are named an identifier (ISIN), followed by “_1”. There also files with identifiers and stored with _2 _3 _4, but I don’t have to consider them. All the files are in a specific pathfolder.
What I need to do is the following.
- Open all of them and create a new column which is the absolute difference between “close” and “open”
- From this column I need to take:1. the minimum value excluding 0. So, actually I need to take the second minimum difference 2. Average (excluding when again the absolute difference is 0) 3. Median (excluding 0)
- These new values, together with the ISINs should go to a new stata dataset.
ISIN | Value Second minimum difference | Mean | Median |
XXXX | |||
YYYY | |||
ZZZ |
Comment