Converting a Google Sheets spreadsheet to Calc and need help with a formula

Hey All,

I used to use Google Sheets to do spending tracking and I’ve recently converted it to an ODS file. I have it working pretty much as it used to with one exception. On one of the sheets in the file I had a filter function that was able to pull in data from all the other sheets, but filter isn’t a formula that is supported in Calc, so I’m not sure how to proceed. The way that it works is that I have a drop down in one of the cells where I can pick the spending category, then the filter function would scan through the month sheets (1-12) and display any line where it had the same category as what I picked in the drop down. Here’s the formula from Google Sheets:

iferror(filter({‘1’!A:F;‘2’!A:F;‘3’!A:F;‘4’!A:F;‘5’!A:F;‘6’!A:F;‘7’!A:F;‘8’!A:F;‘9’!A:F;‘10’!A:F;‘11’!A:F;‘12’!A:F},{‘1’!B:B=$A$1;‘2’!B:B=$A$1;‘3’!B:B=$A$1;‘4’!B:B=$A$1;‘5’!B:B=$A$1;‘6’!B:B=$A$1;‘7’!B:B=$A$1;‘8’!B:B=$A$1;‘9’!B:B=$A$1;‘10’!B:B=$A$1;‘11’!B:"&"B=$A$1;‘12’!B:B=$A$1}),“n/a”)

On the filter sheet the drop down is in cell A1, then on each of the month sheets columns A through F contain the data for each spending thing (date, category, business, etc) and column B is where the category sits. Is there any way for me to replicate this in Calc? Any help is appreciated.

Can you tell in clear words what that formula is supposed to return?
(Which data shall be “pulled in” to which positions?)

IMHO the main flaw in design. Put all data in one sheet and you can easily filter from there. If you think it is necessary to maintain seperate copies of the month data, you can set filters to output at another sheet (January, Feb. ). Most of your formulas will be easier to use then, because there is no need to work on 12 sheets.
.
And it may be the first step to convert the bunch of sheets into a proper database for all years… (Remember: LibreOffice comes with a free database, so no need to do everything in Excel, because Access was not included in the bought software.)

You can try with this extension
https://extensions.libreoffice.org/en/extensions/show/27434
it has the FILTER function, but verify it works as you expect.

Thanks for your reply. I’ve been trying to make it work but I’m running into issues. If I enter the formula in exactly as I had it originally and press Enter or Ctrl-Shift-Enter then I get Err:501. If I try to change the formula to remove the IFERROR section and instead put ,"" at the end of the FILTER formula like they do in Excel then I get Err:539. So, the first problem I’m facing is how to make it work so that it can check multiple sheets at the same time.

I then tried bringing the formula down to checking only sheet ‘1’ like this: =FILTER(‘1’!A:F,‘1’!B:B=$A$1,"") and then pressing Ctrl-Shift-Enter and it takes a while but it does return the right results. The problem after this is that changing the drop down to change the category makes it go a bit wonky. It doesn’t change the size of the array from the first time it was run. For example, if I picked a category and it returned 2 lines from sheet ‘1’, then I pick something different where there are 16 lines on sheet ‘1’, it will display only 2 lines and leave out the other 14. In order to make this work I seem to have to delete the entire array of data, then re-enter the formula and press Ctrl-Shift-Enter.

Is there any way to make this all work?

According to GitHub - goosepirate/lox365: ⚗️ Lox365: XLOOKUP for LibreOffice the FILTER function should work as in Excel, maybe better to comment there the difference of operation with Excel.

Add here an example file, perhaps it could help.

Ah, I think this is an issue of Calc not supporting dynamic arrays or inline array content. I guess I’ll have to wait until that’s supported for this to work properly. Thanks for your help.

It does not support dynamic arrays, but it does support inline arrays.
https://help.libreoffice.org/latest/en-US/text/scalc/01/04060107.html?DbPAR=CALC#bm_id3147273
search for ’ Using Inline Array Constants in Formulas’

BTW a sample file could be helpful,

Bug 127808 - Add dynamic arrays in to Calc

1 Like