Lookup - Last non Zero Value

biggsy3

New Member
Joined
Jan 27, 2014
Messages
42
This is the formula that im currently using but I'm hoping someone can help me modify it.

=LEFT(LOOKUP(2,1/(Raw!$A$2:$A$5000&Raw!$B$2:$B$5000=$A8&I$6),Raw!$L$2:$L$5000))

This lookup works great, but im looking for it to find the last non-zero value.


For example my table looks something like this:

Colour Status
Red Pass
Blue Fail
Green
Red
Blue Pass
Green Fail

In this case using that formula to search for Red will result in a 0 as the last Red doesn't have a Status, but what I would like it to do is find the last non-zero value. Can anyone help me?
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
Sorry I didnt explain it very well, I tried to use an example that doesn't explain it very well.

A8 is the colour
I6 is another criteria that it looks for in ''Raw!$B$2:$B$5000''

A8 and I6 will always contain something.

However ''
Raw!$L$2:$L$5000'' containing the status will not.

Hopefully this makes more sense.


 
Upvote 0
=LEFT(LOOKUP(2,1/(A2:A10&B2:B10=D1&D2),C2:C10))


Colour____Model____Status_______Red
Red________x_______Pass________x
Blue________y_______Fail
Green_______z_______Pass
Green_______x_______Fail
Red_________x_______(Blank)
Green_______x_______Fail
 
Last edited:
Upvote 0
Control+shift+enter, not just enter:

=IFERROR(LEFT(LOOKUP(REPT("z",255),IF(Raw!$A$2:$A$5000=$A8,IF(Raw!$B$2:$B$5000=I$6,IF(1-(Raw!$L$2:$L$5000=""),Raw!$L$2:$L$5000))))),"")
 
Upvote 0
The formula im currently using will return an error for ''Red'' because it's blank, but what I would like it to do is find the last non-zero value.
 
Upvote 0

Forum statistics

Threads
1,224,824
Messages
6,181,186
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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