Nov 28 2019 05:04 AM
Hey guys.
I need to know the formula to Extract data from Column A based on Non -zero values in Column B.
I have successfully done this task in past to extract the data from same column using the combination of different excel functions e.g. Index, Aggregate, Row, CountA etc.
But unable to do it when criteria is in another column.
Please look the attachment.
Nov 28 2019 05:29 AM
SolutionPlease try this...
In E2
=IF(ROWS(D$2:D2)>COUNTIFS($A$2:$A$10003,"<>",$B$2:$B$10003,">0"),"",INDEX($A$2:$A$10003,AGGREGATE(15,6,(ROW($A$2:$A$10003)-ROW($A$2)+1)/(($A$2:$A$10003<>"")*($B$2:$B$10003>0)),ROWS(D$2:D2))))
and copy it down.
Nov 28 2019 12:48 PM
Another variant is
=IFERROR(INDEX($A$2:$A$10003,AGGREGATE(15,6,1/($B$2:$B$10003<>0)*(ROW($B$2:$B$10003)-ROW($B$1)),(ROW()-ROW($E$1)))),"")
in E2
Nov 28 2019 07:01 PM
If ($A$2:$A$10003<>"") condition is skipped, the formula will also pick all the blank cells in column A where corresponding values in column B are greater than 0 and as a result, the formula cells will display zeros.
Nov 28 2019 08:35 PM
Awesome.
That is working.
Thanks very very very much.:)
Nov 28 2019 08:38 PM
Nov 28 2019 08:39 PM
Nov 28 2019 08:42 PM
Jan 02 2022 01:09 AM
Is there anyway to display both columns (A,B) of the fields ?
Please advise how to?
Nov 28 2019 05:29 AM
SolutionPlease try this...
In E2
=IF(ROWS(D$2:D2)>COUNTIFS($A$2:$A$10003,"<>",$B$2:$B$10003,">0"),"",INDEX($A$2:$A$10003,AGGREGATE(15,6,(ROW($A$2:$A$10003)-ROW($A$2)+1)/(($A$2:$A$10003<>"")*($B$2:$B$10003>0)),ROWS(D$2:D2))))
and copy it down.