1

I have three sheets 1,2 and 3. There are three columns on sheet 2 and 3: name (A), surname (B), age(C). How can I select men whose age is >=30 from sheet 2 and 3, order them by age and show the result on sheet 1 (also 3 columns)? I mean something equivalent to SELECT name,surname,age FROM sheet2,sheet3 WHERE age=>30 ORDER BY age and show result on sheet 1.

1
  • The site isn't intended as a code writing service. Users who volunteer their time are happy to help people solve specific problems that they are unable to solve, themselves. You will get a better response if you explain what you've tried, the problems with the results, and what specific problem you need help with. If you don't know where to start, at least explain your thinking about an approach, and what's unclear about information you've researched. It's also helpful for context to include a mockup or screenshots of your spreadsheet. Are your "variables" named ranges or cell references?
    – fixer1234
    Oct 12, 2015 at 18:24

1 Answer 1

0

While Excel will support some SQL, Calc does not. Staying within Calc, to get the results on sheet 1 will take multiple steps:

Highlight your entire table on sheet 2, including the header row. Select Data→Filter→Standard Filter and in the popup window select field name Age, condition >= and value 30. Copy and paste the resulting filtered table (including header row, if needed) to sheet 1.

Repeat that procedure on sheet 3, copy and pasting the results (this time excluding the header row) to sheet 1 below your first copy-paste.

Now, highlight your entire table on sheet 1, including the header row, and choose Data→Sort and sort by age.

If you need to do this frequently, it might be worthwhile to look into connecting a Base file to the Calc files so you can treat the data in the spreadsheet as database tables. While this would be fairly complicated, I believe it would be less work than figuring out macro code to do the filter/copy/filter/copy/sort procedure.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .