Lookup but ignore zero values

drluke

Active Member
Joined
Apr 17, 2014
Messages
314
Office Version
  1. 365
Platform
  1. Windows
Sheet 1
ABCDE
1North810.00A0019
2North90.00A001
3North730.00A002
4West950.00A006
5West880.00A012
6West90.00A004
<colgroup><col width="62" style="width: 47pt;" span="6"> <tbody> </tbody>
In sheet 2 at A1 I need a formula that will give me all the values in col D of shee1 where col B = E1 but ignoring rows that are zero in col C.

Any advice would be much appreciated.
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
Copy down as need


Book1
A
150
Sheet2
Cell Formulas
RangeFormula
A1{=IF(ROWS(A$1:A1)>COUNTIFS(Sheet1!$C$1:$C$7,Sheet1!$F$1,Sheet1!$D$1:$D$7,">0"),"",INDEX(Sheet1!$D$1:$D$7,SMALL(IF(Sheet1!$C$1:$C$7=Sheet1!$F$1,IF(Sheet1!$D$1:$D$7>0,ROW(Sheet1!$D$1:$D$7)-ROW(Sheet1!$D$1)+1)),ROWS(A$1:A1))))}
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0
Thank you for this. My bad as I didn't explain properly. I need a list in sheet 2 starting from A1 that will give me all the values in sheet 1 col D where col B = E1 but skip zero values in col C. So I would expect to see the following in sheet 2 A1-A2

A001
A006
 
Upvote 0
Why A001 ?

Sheet2

A1=IFERROR(INDEX(Sheet1!$D$1:$D$6,SMALL(IF(Sheet1!$B$1:$B$6=Sheet1!$E$1,IF(Sheet1!$C$1:$C$6<>Sheet1!$C$2,ROW(Sheet1!$D$1:$D$6)-ROW(Sheet1!$D$1)+1)),ROWS(Sheet1!$D$1:Sheet1!D1))),"") control +shift+enter copy down
 
Upvote 0
In A1 of Sheet2 control+shift+enter, not just enter, and copy down:

=IFERROR(INDEX(Sheet1!$D$1:$D$6,SMALL(IF(Sheet1!$B$1:$B$6=Sheet1!$E$1,IF(ISNUMBER(1/Sheet1!$C$1:$C$6),ROW(Sheet1!$D$1:$D$6)-ROW(Sheet1!$D$1)+1)),ROWS($A$1:A1))),"")
 
Upvote 0

Forum statistics

Threads
1,215,214
Messages
6,123,660
Members
449,114
Latest member
aides

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top