Excel equation to find last non-zero value in column (must look at all the values in column)

cching

New Member
Joined
Apr 20, 2016
Messages
20
Hello,

I currently have an equation that will give me the last non-zero value in the column. However, my equation works by looking through the column from the top, and once it sees a 0 it will stop and output the value above it instead of going through the entire list.

Example

Column AColumn B
111
211
310
49
58
67
76
85
94
103
112
121
130
148
158
168
178
188
198
2012
2113
2212
2313
2412
2513
2613
2713
2813
2913
3013
3113
3213
3313
340
350
360
370
380
390

<colgroup><col><col></colgroup><tbody>
</tbody>

The equation i have is

=INDEX(B2:B40,MATCH(0,B2:B40,0)-1)

which will output "1" since it found the "0" at row 13, and outputted the value in row 12.

How to I get it so that it will look through the entire column and output the last non-zero value, in this case, it should be "13"

Thanks
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand

Forum statistics

Threads
1,215,507
Messages
6,125,212
Members
449,214
Latest member
mr_ordinaryboy

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