Filter Array Formula Results

jsaluki

New Member
Joined
Aug 17, 2018
Messages
3
Hi,

A B C D
Starting Balance 120.00 150.00 200.00
Net Cashflow 0.00 -80.00 500.00
Ending Balance 120.00 30.00 700.00


I know I can get the whole row returned {0.00, -80.00, 500.00} with the following array formula

=INDEX(B1:D3,MATCH("Net Cashflow",$A:$A,0),0)

But how would I get just the non-zero values returned as a row (i.e. Net Cashflow <> 0)?

Further, my end result is the column numbers that contain non-zero numbers for the Net Cashflow row.

Thanks.
 

Aladin Akyurek

MrExcel MVP
Joined
Feb 14, 2002
Messages
85,138
IF(ISNUMBER(1/INDEX($B$2:$D$4,MATCH("net cashflow",$A$2:$A$4,0),0)),INDEX($B$2:$D$4,MATCH("net cashflow",$A$2:$A$4,0),0))

should deliver the array: {FALSE,-80,500}
 

jsaluki

New Member
Joined
Aug 17, 2018
Messages
3
Thanks, but ultimately I need the column numbers (or at least the cell addresses) of the array results and the false as the first entry would probably not work.
 

Aladin Akyurek

MrExcel MVP
Joined
Feb 14, 2002
Messages
85,138
Thanks, but ultimately I need the column numbers (or at least the cell addresses) of the array results and the false as the first entry would probably not work.
You did not specify what you want to do with the resulting array...
 

jsaluki

New Member
Joined
Aug 17, 2018
Messages
3
You did not specify what you want to do with the resulting array...[/QUOT

I'm actually executing the array formula on a spreadsheet using the Spreadsheetgear API and need the column numbers of the non-zero values in the "Net Cashflow" row. So in this case {3, 4}
 

Aladin Akyurek

MrExcel MVP
Joined
Feb 14, 2002
Messages
85,138
You did not specify what you want to do with the resulting array...[/QUOT

I'm actually executing the array formula on a spreadsheet using the Spreadsheetgear API and need the column numbers of the non-zero values in the "Net Cashflow" row. So in this case {3, 4}
Control+shift+enter, not just enter, and copy down:

=IFERROR(SMALL(IF(ISNUMBER(1/INDEX($B$2:$D$4,MATCH("net cashflow",$A$2:$A$4,0),0)),COLUMN($B$2:$D$4)),ROWS($1:1)),"")

Try to use the resulting numeric range
 

Forum statistics

Threads
1,081,618
Messages
5,360,055
Members
400,565
Latest member
Tommy O

Some videos you may like

This Week's Hot Topics

  • VBA (Userform)
    Hi All, I just would like to know why my code isn't working. Here is my VBA code: [CODE=vba]Private Sub OKButton_Click() Dim i As Integer...
  • List box that changes fill color
    Hello, I have gone through so many pages trying to figure this out. I have a 2020 calendar that depending on the day needs to have a certain...
  • Remove duplicates and retain one. Cross-linked cases
    Hi all I ran out of google keywords to use and still couldn't find a reference how to achieve the results of a single count. It would be great if...
  • VBA Copy and Paste With Duplicates
    Hello All, I'm in need of some input. My VBA skills are sub-par at best. I've assembled this code from basic research and it works but is...
  • Macro
    is it possible for a macro to run if the active cell value is different to the value above it
  • IF DATE and TIME
    I currently use this to check if date has passed but i also need to set a time on it too. Is it possible? [CODE=vba]=IF(B:B>TODAY(),"Not...
Top