[Solved] Match any non-zero number

Discuss the spreadsheet application
Locked
chris129
Posts: 2
Joined: Wed Jun 17, 2026 1:08 am

[Solved] Match any non-zero number

Post by chris129 »

I have this formula to return row numbers from another sheet. It allows me to collect only the data I need into a clean sheet without having to filter and hide/unhide rows and columns all of the time. This particular formula will return row numbers that contain the number 72. What I am looking for is a formula that returns row numbers that contain any number besides zero or a blank, instead of the specific number 72. A helper column is not an option as this spreadsheet already looks like a crime scene. Anyway to do this?

=(MATCH(72;(INDIRECT("$Plant List.$AX$"&$A5+1&":$AX$5000"));0)+$A5) This formula is in Cell A6.
Last edited by MrProgrammer on Wed Jul 01, 2026 10:46 pm, edited 1 time in total.
Reason: Tagged ✓ [Solved]; Link to tutorial provided and no further questions from chris129
OpenOffice 4.1.16 | Mac OS 15.7.4
FJCC
Moderator
Posts: 9653
Joined: Sat Nov 08, 2008 8:08 pm
Location: Colorado, USA

Re: Match any non-zero number

Post by FJCC »

This formula, entered as an array formula, returns the first non zero value in E1:E10.

Code: Select all

=MATCH(1;((E1:E10<>0)*ROW(E1:E10))>0;0)
To enter it as an array formula, type it in a cell and finish with CTRL + Shift + Enter.
OpenOffice 4.1 on Windows 10 and Linux Mint
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
chris129
Posts: 2
Joined: Wed Jun 17, 2026 1:08 am

Re: Match any non-zero number

Post by chris129 »

How should the formula that you provided modify the formula that I have? I tried splicing them together and it doesn't work. I also have several rows of non-zero numbers that need to be shown.
OpenOffice 4.1.16 | Mac OS 15.7.4
User avatar
MrProgrammer
Moderator
Posts: 5480
Joined: Fri Jun 04, 2010 7:57 pm
Location: Wisconsin, USA

Re: Match any non-zero number

Post by MrProgrammer »

chris129 wrote: Wed Jun 17, 2026 1:52 am What I am looking for is a formula that returns row numbers that contain any number besides zero or a blank
Create a new sheet uses formulas to filter by the column with the numbers you want to check. The new sheet will only display the filtered rows. It dynamically updates as you change the source data. If desired you can display a subset of the columns.
[Tutorial] Sorting and Filtering data with formulas

If you need any additional assistance attach a spreadsheet demonstrating the difficulty (remove confidential information then use Post Reply, not Quick Reply, and don't attach a picture instead of the spreadsheet itself). I will not help further unless you attach a spreadsheet document. You will need to explain what column in what sheet contains the numbers to check for nonzero values. If the real spreadsheet is large and complex it may be easier for you to attach a small sample of the data which shows twenty or so rows and has the relevant columns in one sheet. Just make sure it illustrates the situation you have.

chris129 wrote: Wed Jun 17, 2026 1:52 am A helper column is not an option as this spreadsheet already looks like a crime scene.
I decline to provide assistance without using helper columns. The formulas become inscrutable and difficult to construct or debug.

chris129 wrote: Wed Jun 17, 2026 1:52 am … without having to filter and hide/unhide rows and columns all of the time.
A recorded macro can hide and unhide columns. You can create Scenarios (see Calc help) that indicate which rows are to be displayed, then use Data → Filter → Standard Filter on the sheet. A recorded macro can select a scenario and use Data → Refresh Range to show and hide filtered rows. It's a bit clumsy, but you only need to do this once. Actually a recorded macro can achieve the same effect as a scenario to set values for the filter and refresh the range. Personally I would use the Filter Data with Formulas technique.
[Tutorial] Favorite Recorded Calc Macros

chris129 wrote: Wed Jun 17, 2026 5:18 pm I tried splicing them together and it doesn't work.
It doesn't work is meaningless until you attach a spreadsheet file to show your data and formulas. Simply providing the text of the formula is also meaningless without the data.

If this solved your problem please go to your first post use the Edit ✏️ button and add [Solved] to the start of the Subject field. Select the green checkmark icon at the same time.
Mr. Programmer
AOO 4.1.7 Build 9800, MacOS 13.7.8, iMac Intel.   The locale for any menus or Calc formulas in my posts is English (USA).
Locked