Lookup Value That Greater Than Zero

fireboltpk

New Member
Joined
May 29, 2017
Messages
9
Hi,

I have a data set with 600 products where I need to pickup the value that is greater than zero. Below is an example of my data set and what I need to pick.

ProductPrice
Coke0
Coke0
Coke0
Coke7
Fanta0
Fanta5
Fanta0

<tbody>
</tbody>

What I basically want is that when I do a lookup for Coke and Fanta, my return values are 7 and 5.

Regards,

M
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
Heres one way.

=LOOKUP(2,1/(($A$2:$A$8=E1)*($B$2:$B$8>0)),$B$2:$B$8)

Place 'Coke' or 'Fanta' into E1 and your table in A1:B8.
 
Upvote 0
Or………..

=1/LOOKUP(9^9,1/B$2:B$8/(A$2:A$8=E1))

Regards
Bosco
 
Upvote 0
Other possible options.
F1 if you have Office 365
G1 for all versions but this is an array formula so should be entered without the {} but confirmed with Ctrl+Shift+Enter, not just Enter. If confirmed correctly, Excel will insert the {}. The formula can then be copied down.

Excel Workbook
ABCDEFG
1ProductPriceCoke77
2Coke0Fanta55
3Coke0
4Coke0
5Coke7
6Fanta0
7Fanta5
8Fanta0
Max
 
Last edited:
Upvote 0
If you only have one value > 0 for each product, you could use:

=SUMIF(A:A,"Coke",B:B)

for example.
 
Upvote 0

Forum statistics

Threads
1,214,785
Messages
6,121,543
Members
449,038
Latest member
Guest1337

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