VLOOKUP, If Zero Skip to Next Result

Sowelu

New Member
Joined
Mar 18, 2009
Messages
27
Hi,
I've searched on forums for a few hours but couldn't find a solution for this.

Below is the data I have.

Say I need to get values from Column C. VLOOKUP'ed values return the first value, but i need it to move on to the next result if the first one = 0.
so I will get

123 - not 0, but 0.22
234 - 0.1
345 - 0.
TEST_LOOKUP.xls
ABCDEFGHI
1Number123
21230.200.2
32340.10.10
4345000
512300.220
6234000.15
71230.240.240.24
8
Sheet1


I have the sheet sorted by other fields like I need it to, so I can't change sorting.
Items are not in order as you see, so I can't find the row and move down one.

Please Help!! :(

THANKS!
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
Couldn't you just use this in column E...

=IF(C2=0,D2,C2)

If C2=0, I need C5 -- not D2.

This is a small example, my spreadsheet is huge and I will not know if one cell is zero where down the column is the NEXT value that would not be zero.

I am trying to stay away from manipulating spreadsheet -- unless there is a short way.
Because I foresee doing this over and over again every time I pull the data, I'd rather have a formula or VBA code (even though I am not too familiar with writing it) that will go through the data and pull out first non-zero results.

I appreciate the help.
 
Upvote 0
Assuming that F2 contains the number of interest, such as 345, try...

Confirmed with CONTROL+SHIFT+ENTER:

=INDEX($C$2:$C$7,MATCH(1,IF($A$2:$A$7=F2,IF($C$2:$C$7<>0,1)),0))

Hope this helps!
 
Upvote 0
Assuming that F2 contains the number of interest, such as 345, try...

Confirmed with CONTROL+SHIFT+ENTER:

=INDEX($C$2:$C$7,MATCH(1,IF($A$2:$A$7=F2,IF($C$2:$C$7<>0,1)),0))

Hope this helps!


gives me an error... ((((
TEST_LOOKUP.xls
ABCDEFGHI
1Number123
21230.200.2345#N/A
32340.10.10
4345000
512300.220
6234000.15
71230.240.240.24
8
Sheet1
 
Upvote 0
Did you confirm the formula with CONTROL+SHIFT+ENTER, not just ENTER?
 
Upvote 0
Did you confirm the formula with CONTROL+SHIFT+ENTER, not just ENTER?


yes, I think error happens
because it finds this part
to be false

$C$2:$C$7<>0

it shows 0<>0.

I am not sure if this is the intention..
Thanks for helping me, Domenic :)
 
Upvote 0

Forum statistics

Threads
1,214,424
Messages
6,119,407
Members
448,894
Latest member
spenstar

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